Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903861 - app-shells/bash: add some $HISTCONTROL setting for interactive shells by default
Summary: app-shells/bash: add some $HISTCONTROL setting for interactive shells by default
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2023-04-05 08:59 UTC by Christian Bricart
Modified: 2024-05-10 18:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Christian Bricart 2023-04-05 08:59:47 UTC
It would be really nice to have some HISTCONTROL setting system-wide by default.

i.e. I really miss at least a HISTCONTROL=ignorespace to be set (system-wide).

at least I made it a habbit to always prefix commands like »reboot«, »poweroff«, … (ymmv) with a space, to have them not end up in the history and unintentionally call them again by sticky fingers

of course, everyone is able to set that in one's own ~/.bashrc or even drop some file in /etc/bash/bashrc.d/ by their system provisioning solution, but that might turn out to be very cumbersome to most users.

however, I think this would be a really nice addition to system default's /etc/bash/bashrc (already being delivered by app-shells/bash from its $FILESDIR) wrt default user experience.

Reproducible: Always
Comment 1 Yuri 2023-09-01 19:48:29 UTC
Having at least the 'ignorespace' set would be great since space is customary used for prefixing sensitive commands (e.g. passwords as a part of a command).
Comment 2 kfm 2024-05-10 18:07:24 UTC
It's such a pity that HISTIGNORE does not treat its patterns as extended globs unless the extglob shell option is set. Were it to do so, the issue described by Christian could be dealt with more effectively - and less invasively - by setting something like:

Comment 3 kfm 2024-05-10 18:22:44 UTC
Or, rather:


I may try submitting a request for HISTIGNORE to always act as if extglob were enabled for 5.3, even though I generally expect for Ramey to reject anything I suggest.