aboutsummaryrefslogtreecommitdiff
path: root/ksh/kshrc.d
diff options
context:
space:
mode:
Diffstat (limited to 'ksh/kshrc.d')
-rw-r--r--ksh/kshrc.d/keep.ksh4
-rw-r--r--ksh/kshrc.d/prompt.ksh12
2 files changed, 8 insertions, 8 deletions
diff --git a/ksh/kshrc.d/keep.ksh b/ksh/kshrc.d/keep.ksh
index f61a7a4d..861e1b2b 100644
--- a/ksh/kshrc.d/keep.ksh
+++ b/ksh/kshrc.d/keep.ksh
@@ -100,8 +100,8 @@ EOF
case $name in
# NAME must start with letters or an underscore, and contain no
- # characters besides letters, numbers, or underscores
- *[!a-zA-Z0-9_]*|[!a-zA-Z_]*)
+ # characters besides letters, numbers, underscores, or dashes
+ [!a-zA-Z_]*|*[!a-zA-Z0-9_-]*)
printf 'ksh: %s: %s not a valid NAME\n' \
"$self" "$name" >&2
((errors++))
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index 64e22e8e..99d999de 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -12,16 +12,12 @@ function prompt {
# Turn complex, colored PS1 and debugging PS4 prompts on
on)
- # Basic prompt shape depends on whether we're in SSH or not
+ # Prompt has hostname via SSH outside of screen/tmux
PS1=
- if [[ -n $SSH_CLIENT || -n $SSH_CONNECTION ]] ; then
+ if [[ -n $SSH_CLIENT && -z $STY && -z $TMUX ]] ; then
PS1=$PS1'${HOSTNAME%%.*}:'
fi
- # Add sub-commands; working directory with ~ abbreviation, VCS, job
- # count, and previous command return value
- PS1=$PS1'$(ret=$?;jobc=$(jobs -p|sed -n '\''$='\'');prompt pwd;prompt vcs;prompt job;prompt ret;:)'
-
# Add a helpful prefix if this shell appears to be exotic
typeset ksh
case $KSH_VERSION in
@@ -34,6 +30,10 @@ function prompt {
(*) PS1=$ksh:$PS1 ;;
esac
+ # Add sub-commands:
+ ## VCS, job, and return status checks as suffixes
+ PS1=$PS1'$(ret=$?;jobc=$(jobs -p|sed -n '\''$='\'');prompt pwd;prompt vcs;prompt job;prompt ret;:)'
+
# Add prefix and suffix
PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}'