In bash, a HISTIGNORE='c' doesn't store a command line of a singlecto the memory list of commands. The similarly namedHISTORY_IGNOREin zsh is used to avoid sending the command to the history **file**, which is something different. AHIST_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:28clearand doesn't actually clean the screen. Also, a singlecis easier to reach than Ctrl+L – noibe Mar 14 '20 at 17:56zshaddhistoryincludes the terminating newline. – Mar 14 '20 at 21:19