From 5cb43772dc26cceddc3496ce99ba3b944f49a8e2 Mon Sep 17 00:00:00 2001 From: Johannes Baiter Date: Tue, 14 Feb 2023 08:14:05 +0100 Subject: Add `history_filter` cfg to exclude commands from history (#515) (#716) 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. --- atuin-client/src/settings.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'atuin-client/src/settings.rs') diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 3cefe1cb..2975edba 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -9,6 +9,7 @@ use config::{Config, Environment, File as ConfigFile, FileFormat}; use eyre::{eyre, Context, Result}; use fs_err::{create_dir_all, File}; use parse_duration::parse; +use regex::RegexSet; use semver::Version; use serde::Deserialize; @@ -112,6 +113,9 @@ pub struct Settings { pub filter_mode_shell_up_key_binding: FilterMode, pub shell_up_key_binding: bool, pub exit_mode: ExitMode, + #[serde(with = "serde_regex", default = "RegexSet::empty")] + pub history_filter: RegexSet, + // This is automatically loaded when settings is created. Do not set in // config! Keep secrets and settings apart. pub session_token: String, -- cgit v1.3.1