aboutsummaryrefslogtreecommitdiff
path: root/ksh/kshrc.d/prompt.ksh
diff options
context:
space:
mode:
Diffstat (limited to 'ksh/kshrc.d/prompt.ksh')
-rw-r--r--ksh/kshrc.d/prompt.ksh12
1 files changed, 5 insertions, 7 deletions
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index 1d4db926..c5f3ee1b 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -15,7 +15,7 @@ function prompt {
# Basic prompt shape depends on whether we're in SSH or not
PS1=
if [[ -n $SSH_CLIENT ]] || [[ -n $SSH_CONNECTION ]] ; then
- PS1=$PS1'$USER@${HOSTNAME%%.*}:'
+ PS1=$PS1'${HOSTNAME%%.*}:'
fi
# Add sub-commands; working directory with ~ abbreviation, VCS, job
@@ -30,9 +30,7 @@ function prompt {
(*'MIRBSD KSH'*) ksh=mksh ;;
esac
case ${SHELL##*/} in
- ('') ;;
- (ksh) ;;
- ("$ksh") ;;
+ (''|ksh|"$ksh") ;;
(*) PS1=$ksh:$PS1 ;;
esac
@@ -193,7 +191,7 @@ function prompt {
PS3='? '
PS4='+ '
if [[ -n $SSH_CLIENT || -n $SSH_CONNECTION ]] ; then
- PS1=$(id -nu)'@'$(hostname -s)'$ '
+ PS1=$(hostname -s)'$ '
fi
;;
@@ -234,5 +232,5 @@ function prompt {
esac
}
-# Start with full-fledged prompt
-prompt on
+# Default to a full-featured prompt, but use PROMPT_MODE if that's set
+prompt "${PROMPT_MODE:-on}"