aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-28 22:53:21 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-28 22:53:21 +1300
commit98fd6a8802d2fbf1e7727b188b4ea5acc5f5fc61 (patch)
tree8a2bb4a03199fb43e1d98965fea0257f4d689d75 /sh/shrc.d
parentMerge branch 'master' into port/bsd/freebsd (diff)
parentAdd completion for finger(1) (diff)
downloaddotfiles-98fd6a8802d2fbf1e7727b188b4ea5acc5f5fc61.tar.gz
dotfiles-98fd6a8802d2fbf1e7727b188b4ea5acc5f5fc61.zip
Merge branch 'master' into port/bsd/freebsd
Diffstat (limited to 'sh/shrc.d')
-rw-r--r--sh/shrc.d/prompt.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/shrc.d/prompt.sh b/sh/shrc.d/prompt.sh
index a481b5bb..f1b67fb4 100644
--- a/sh/shrc.d/prompt.sh
+++ b/sh/shrc.d/prompt.sh
@@ -3,3 +3,9 @@
# it to break the export and then just setting them as simple variables
unset PS1 PS2 PS3 PS4
PS1='$ ' PS2='> ' PS3='? ' PS4='+ '
+
+# If we have an SSH_CLIENT or SSH_CONNECTION environment variable, put the
+# username and hostname in PS1 too.
+if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ] ; then
+ PS1=$(id -nu)'@'$(hostname)'$ '
+fi