Skip to content
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

Add history_filter setting to exclude commands from history #716

Merged
merged 1 commit into from Feb 14, 2023

Conversation

jbaiter
Copy link
Contributor

@jbaiter jbaiter commented Feb 13, 2023

Adds a new history_filter setting through which users can specify a list of regular expressions that match commands that should not be recorded in the history.

Example configuration:

## prevent commands matching any of these regexes from being written to history.
## Note that these regular expressions are unanchored, i.e. if they don't start
## with ^ or end with $, they'll match anywhere in the command.
## For details on the supported regular expression syntax, see
## https://docs.rs/regex/latest/regex/#syntax
history_filter = [
   "^secret-cmd",
   "^innocuous-cmd .*--secret=.+"
]

Fixes #515

@jbaiter jbaiter changed the title Add history_filter cfg to exclude commands from history (implements #515) Add history_filter setting to exclude commands from history (implements #515) Feb 13, 2023
@conradludgate conradludgate changed the title Add history_filter setting to exclude commands from history (implements #515) Add history_filter setting to exclude commands from history Feb 13, 2023
@conradludgate
Copy link
Collaborator

Thanks!

Adds a new `history_filter` setting through which users can specify a
list of regular expressions that match commands that should not be
recorded in the history.
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice - thank you!

@conradludgate conradludgate merged commit 5cb4377 into atuinsh:main Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Excluding commands from being added to history
3 participants