Add custom SSH prompt

This commit is contained in:
ItsDrike 2021-04-19 10:47:00 +02:00
parent 31e8b174e3
commit 4458c4f7ee
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD

View file

@ -25,8 +25,8 @@ setopt promptsubst # enable command substitution in prompt
# Primary Prompt
[ "$EUID" -eq 0 ] && PS1="$RED%n$RESET" || PS1="$GREEN%n$RESET" # user@machine
#PS1+=" $BLUE%~" # Working directory, no autotrim
PS1+=" $BLUE%(5~|%-1~/…/%3~|%4~)" # Working directory + autotrim
#PS1+=" $BLUE%~" # Working directory
PS1+=" $BLUE%(5~|%-1~/…/%3~|%4~)"
PS1+="\$(git_prompt)"
PS1+=" $PURPLE%(!.#.»)$RESET " # Final symbol (# or »)
@ -35,3 +35,8 @@ PS2="$RED\ $RESET"
# Right side prompt (on error)
RPS1="%(?..$RED%? ↵$RESET)"
# SSH Prompt
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
PS1="$PURPLE(ssh) $RESET${PS1}"
fi