Skip to content

Commit

Permalink
Easier prompt management, when ssh back and forward
Browse files Browse the repository at this point in the history
  • Loading branch information
charnley committed Apr 5, 2024
1 parent a1ca8bb commit eb957cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions dot/tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,7 @@ bind-key -r i run-shell "tmux neww tmux-cheat.sh"

# for image.nvim
set -gq allow-passthrough on

# for ssh variable passthrough
set-option -g update-environment "SSH_CLIENT SSH_TTY"

21 changes: 10 additions & 11 deletions dot/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,20 @@ else
is_mac="0"
fi

if test -z "$SSH_TTY"
then
is_ssh="0"
else
is_ssh="1"
fi

# If non-default hostname
valid_hostnames=(laptop baerbar)
if [[ "$is_mac" == "1" || "`hostname`" == "baerbar" ]];
if [[ "$is_ssh" == "0" ]];
then
PROMPT=''
else
needle=`hostname`
echo $needle
if [[ ${valid_hostnames[(ie)$needle]} -le ${#valid_hostnames} ]]
then
PROMPT='> '
else
# PROMPT='%F{blue}%m > '
PROMPT='%m > '
fi
PROMPT='%F{blue}%m > '
#PROMPT='%m > '
fi

# If non-default username
Expand Down

0 comments on commit eb957cb

Please sign in to comment.