diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-27 13:03:09 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-27 13:03:56 +1300 |
commit | 8cc85ff3ffe5ebd1260ed276fc2b35621ccfba55 (patch) | |
tree | b156c22a29e861b3fb5809365d10e1cfc1b8da26 /sh/shrc.d | |
parent | Update submodules (diff) | |
download | dotfiles-8cc85ff3ffe5ebd1260ed276fc2b35621ccfba55.tar.gz dotfiles-8cc85ff3ffe5ebd1260ed276fc2b35621ccfba55.zip |
Extend "fallback" prompt a bit
Include username/hostname if no SSH variables
Diffstat (limited to 'sh/shrc.d')
-rw-r--r-- | sh/shrc.d/prompt.sh | 6 |
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 |