Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: capture stderr in command substitution



On Mon, Jan 25, 2021 at 8:29 AM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
> > how do you keep a command out of history?
>
> I do it this way:
> [...]
> zle -N execute_no_history
> bindkey '^[M' execute_no_history # my keybinding, customize it as you like

Simpler but same idea:

precmd() { add_history() { true } }
execute_no_history() {
  add_history() { false }
  zle accept-line
}
autoload -z add-zsh-hook
add-zsh-hook zshaddhistory add_history




Messages sorted by: Reverse Date, Date, Thread, Author