Closed
Description
Expected Behavior
When HISTCONTROL
is set to ignorespace
or ignoreboth
, I expect commands with a preceding space to not be stored in history. This is a common expectation to work around situations where it's just easiest to enter a secure string as an argument to a command, and you don't want it stored in history.
Edit: before this inspires a bunch of comments about how this is bad practice, how the secrets are leaked in ps
, etc; none of that is relevant. This is a behavior that the user expects to be supported and because they are unable to opt-out of our use of preexec, this should be addressed.
Current Behavior
The updated preexec library edits HISTCONTROL
with the __bp_adjust_histcontrol function.
Possible Solution
- Remove all references to this function
- Fork and apply a working version of their PR for munging history
Steps to Reproduce
- set HISTCONTROL
- reload
- type command that starts with a space
- history 5