Is there a way to Prevent ZSH from saving specific command in history. I dont want zsh to save git clone //url
command.
Asked
Active
Viewed 184 times
0

Shailesh
- 1
1 Answers
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.

Edgar Magallon
- 4,820

vfbsilva
- 3,697
HISTORY_IGNORE="git clone"
. Check this – Edgar Magallon Dec 08 '22 at 04:37