diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 33387db..e533183 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -36,15 +36,26 @@ setopt NO_SHARE_HISTORY EXTENDED_HISTORY INC_APPEND_HISTORY_TIME setopt HIST_EXPIRE_DUPS_FIRST HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE HIST_REDUCE_BLANKS HIST_VERIFY HIST_FCNTL_LOCK +autoload -Uz add-zsh-hook # Import new commands from the history file function _my_import_history_zshaddhistory() { fc -RI return 0 } -autoload -Uz add-zsh-hook add-zsh-hook zshaddhistory _my_import_history_zshaddhistory +function _my_filter_secrets_zshaddhistory() { + case ${1} in + *"Authorization: Bearer"*) + return 1 ;; + *"--password"*) + return 1 ;; + esac + return 0 +} +add-zsh-hook zshaddhistory _my_filter_secrets_zshaddhistory + ############################## Plugins ######################################### # https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md