I\'m having a lot of trouble getting zsh to shorten my prompt. I\'m currently using zsh with the agnoster theme and oh-my-zsh package manager.
My prompt currently gets a
add this to ~/.zshrc
~/.zshrc
prompt_dir() { prompt_segment blue $CURRENT_FG '%2~' }
Explanatory note: %~ will limit the number of path segments leading up to the current directory to N. I.e. %2~ will show only two last segments: the current directory and its parent directory.
%~
%2~