From 4458c4f7ee9abcf5f822684f2c53123f41571a11 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 19 Apr 2021 10:47:00 +0200 Subject: [PATCH] Add custom SSH prompt --- home/.config/sh/theme | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/home/.config/sh/theme b/home/.config/sh/theme index 6bef957..cc822a9 100755 --- a/home/.config/sh/theme +++ b/home/.config/sh/theme @@ -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