zsh: filter some secrets
This commit is contained in:
parent
21c4f6212d
commit
b04595ac91
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user