I'm switching from bash to zsh.
I want to update my new zsh prompt and looked around to find a way, but I have only found "solutions" via oh-my-zsh.
The goal:
Location: ~/dir_1/dir_1_1/dir_1_1_1
What I have:
Location: dir_1_1_1
The code (source):
PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[green]%}Location: %c%{$reset_color%}$(git_prompt_info) '
dir_1/dir_1_1/dir_1_1_1
is not full path. Not sure what you want, but most people use%~
or%n~
instead of%c
, wheren
is the number of trailing components to show.%c
is deprecated anyway. Read zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html. – Grackle