From: Simon Ruderich Date: Sun, 14 Oct 2012 19:58:19 +0000 (+0200) Subject: zsh/rc: Ctrl-C doesn't store the line if histignorespace applies. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=647db2586be6478d0892fc20994135d748460a80;p=config%2Fdotfiles.git zsh/rc: Ctrl-C doesn't store the line if histignorespace applies. --- diff --git a/zsh/rc b/zsh/rc index 55e9242..be8e8f5 100644 --- a/zsh/rc +++ b/zsh/rc @@ -601,6 +601,12 @@ bindkey '^F' complete-files # for a fix (-r) to handle whitespace/quotes # correctly, both on the Zsh mailing list. TRAPINT() { + # Don't store this line in history if histignorespace is enabled and the + # line starts with a space. + if [[ -o histignorespace && ${BUFFER[1]} = " " ]]; then + return $1 + fi + # Store the current buffer in the history. zle && print -s -r -- $BUFFER