Skip to content
Keep passwords out of your ZSH history
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
README.md
passwordless-history.plugin.zsh

README.md

Passwordless ZSH history

Keep passwords out of your ZSH history

ZSH will let you recover the previous command from history immediately after it has been run. After that it will not be added to history if it matches HISTORY_EXCLUDE_PATTERN

> curl http://username:password@github.com/foo
> # <up-arrow> recovers command with password
> # curl command is not available in history here

To exclude any command from history, prefix with a space. It behaves the same as above:

>  echo "prefixed with space"
> # available here on <up-arrow>
> # Not available here 

Installation

Antibody

antibody bundle jgogstad/passwordless-history

Antigen

antigen bundle jgogstad/passwordless-history

Plain zsh

Add to .zshrc

. /path/to/passwordless-history.plugin.zsh

Customization

Default exclusion pattern is

> echo $HISTORY_EXCLUDE_PATTERN
password|PASSWORD|//[^/]+:[^/]+@

Overwrite variable to customize

> export HISTORY_EXCLUDE_PATTERN="^ykchalresp|$HISTORY_EXCLUDE_PATTERN"
You can’t perform that action at this time.