-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] HISTCONTROL ignore* setting should be respected #115
Comments
@cornfeedhobo thanks for the feedback! This has been brought up a few times in different ways. Here's a few thoughts related that could help or shed light:
Appreciate any thoughts or other options. |
@rcaloras Thanks for the thoughtful reply! I had not seen iTerm's issue when searching. After playing around and thinking about this more, I've come to the conclusion that preexec should do this heavy lifting. I realize that this will make histcontrol inconsistent, but given the fact that this library already requires total control over DEBUG and PROMPT_COMMAND, I think adding this inconsistency is safer than users realizing that commands have been saved to history that contain sensitive information. I've made a comment on the open PR to make the solution work in all versions of bash. I do hope you reconsider this, but in the meantime I will go through our codebase and ask the team what they think about removing |
Greetings ! I'm a contributor to Bash-It and collaborate with @cornfeedhobo. I've just been made aware of this issue thanks to @cornfeedhobo starting a bash-It discussion: Having spent a couple of hours this am researching/thinking on this, here's some unsolicited feedback :)
So, my current feeling is that the way forward is:
Thanks for reading - Hopefully some of this was helpful, -DF [edit] Just want to call out that I missed that @rcaloras did mention |
I've come to understand over the last 24 hours (after I submitted an admittedly grumpy PR to just rip out the history manipulation) that the use case is largely to set the window title or similar with the actual command line entered by the user. Of course this can alsö be used for logging, or perhaps debugging. Aliases are alsö lost from $BASH_COMMAND, so the as-typed may appear substantially different. (E.g., The open PR #96 fully solves the issue for Bash v5 and up by just removing the command from history after saving it; basically bash-preexec emulates the intended behavior. @cornfeedhobo added a comment that makes it compatible with downversion Bash, but the PR was never updated or really touched since then. I've submitted a new PR #119 which integrates the version compatibility. Result is that the user's intended behavior is preserved without compromising the use case requiring the full as-typed command line. I alsö took the opportunity to add handling to the hook so that if HISTCONTROL is set again to include 'ignorespace' then it falls back to $BASH_COMMAND after all. I hope this addresses everyone's needs and can be committed. Thanks, |
@rcaloras, this alsö partially addresses your concern that it's editing history even if the user adds BUT, if the user were to examine |
1 similar comment
@rcaloras, this alsö partially addresses your concern that it's editing history even if the user adds BUT, if the user were to examine |
And I have, at just this moment, learned that @rcaloras appears to be behind BashHub.com which is a significant use case for preserving the command line as-user-typed. |
I understand the current reasoning for removing
ignorespace
andignoreboth
but I think they break such an important expectation for users that, if set, preexec should manually cleanup history, to guarantee this expectation is maintained.The text was updated successfully, but these errors were encountered: