aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/prompt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/prompt.sh')
-rw-r--r--sh/shrc.d/prompt.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/sh/shrc.d/prompt.sh b/sh/shrc.d/prompt.sh
index cb32c113..72cf59b6 100644
--- a/sh/shrc.d/prompt.sh
+++ b/sh/shrc.d/prompt.sh
@@ -11,8 +11,7 @@ PS3='? '
unset PS4
PS4='+ '
-# If we have an SSH_CLIENT or SSH_CONNECTION environment variable, put the
-# hostname in PS1 too.
-if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ] ; then
- PS1=$(hostname -s)'$ '
+# Prompt has hostname via SSH outside of screen/tmux
+if [ -n "$SSH_CLIENT" ] && [ -z "$STY" ] && [ -z "$TMUX" ] ; then
+ PS1=$(hostname -s)$PS1
fi