From 8cc85ff3ffe5ebd1260ed276fc2b35621ccfba55 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 27 Jan 2017 13:03:09 +1300 Subject: Extend "fallback" prompt a bit Include username/hostname if no SSH variables --- ksh/kshrc.d/prompt.ksh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ksh') diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh index 1dcbd864..3f526526 100644 --- a/ksh/kshrc.d/prompt.ksh +++ b/ksh/kshrc.d/prompt.ksh @@ -188,10 +188,13 @@ function prompt { # Revert to simple inexpensive prompts off) - PS1='\$ ' + PS1='$ ' PS2='> ' PS3='? ' PS4='+ ' + if [[ -n $SSH_CLIENT || -n $SSH_CONNECTION ]] ; then + PS1=$(id -nu)'@'$(hostname -s)'$ ' + fi ;; # Abbreviated working directory -- cgit v1.2.3