In bash, a HISTIGNORE='c' doesn't store a command line of a single
cto the memory list of commands. The similarly named
HISTORY_IGNOREin zsh is used to avoid sending the command to the history **file**, which is something different. A
HIST_NO_STORE` also exists in zsh but seems to fail with aliases.
So, it seems that there is no solution to avoid an alias of c
in history.
However, what you are doing, clearing the present window (clear
) and removing the scrollback (printf "\e[3J"
) could also be done with another ANSI control sequence:
ESC c # Full Reset (RIS), VT100.
So, a
printf '\ec'
should be enough.
Defining a keyboard shortcut for that should be simple and will avoid storing any command in the history.
HISTORY_IGNORE
, but I have some trouble getting it to work (possibly because of the alias). – ilkkachu Mar 14 '20 at 16:28clear
and doesn't actually clean the screen. Also, a singlec
is easier to reach than Ctrl+L – noibe Mar 14 '20 at 17:56zshaddhistory
includes the terminating newline. – Mar 14 '20 at 21:19