/ til

TIL: Keeping Secrets Out Of Your ZSH History

I'm a big fan of zsh because of the power and customization it gives you.

One nice little trick I learned is that you can prevent commands from being added to your history by prepending a space to the line. This is useful for preventing any kind of secret, such as an API key, from being saved.

Add setopt HIST_IGNORE_SPACE to your .zshrc and you're good to go!