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

Re: capture stderr in command substitution



> how do you keep a command out of history? 

I do it this way:

precmd(){
    [[ $________tmp___restore_history -eq 1 ]] && {
        unset ________tmp___restore_history
        fc -P
    }
}

execute_no_history(){
    # disable history, will be reactivated in precmd
    fc -p /dev/null
    ________tmp___restore_history=1

    zle accept-line
}
zle -N execute_no_history
bindkey '^[M' execute_no_history # my keybinding, customize it as you like

best

Pier Paolo Grassi


Il giorno lun 25 gen 2021 alle ore 16:55 Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx> ha scritto:
> how do you keep a command out of history?

You can

setopt HIST_IGNORE_SPACE

(capitalization and underscores don't matter) and put a space in front of the command.

Regards,
  Vin



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