0

Is there a way to Prevent ZSH from saving specific command in history. I dont want zsh to save git clone //url command.

1 Answers1

1

You can use the HIST_IGNORE_SPACE option.

setopt HIST_IGNORE_SPACE

From man zshoptions:

HIST_IGNORE_SPACE

Remove command lines from the history list when the first character on the line is a space, or when one of the expanded aliases contains a leading space. Note that the command lingers in the internal history until the next command is entered before it vanishes, allowing you to briefly reuse or edit the line. If you want to make it vanish right away without entering another command, type a space and press return.

vfbsilva
  • 3,697