aboutsummaryrefslogtreecommitdiff
path: root/ksh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-27 02:26:00 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-27 02:26:00 +1300
commit90dcadfb2e6e82b7d5e9bdbac2c109433f70caf7 (patch)
treec4d5ba26f25be189cf76fd6eef1103b9fe068b84 /ksh
parentAdd another issue (diff)
downloaddotfiles-90dcadfb2e6e82b7d5e9bdbac2c109433f70caf7.tar.gz
dotfiles-90dcadfb2e6e82b7d5e9bdbac2c109433f70caf7.zip
Realised easy win avoiding subshells
And also the PROMPT_RETURN fudge in Bash/Zsh
Diffstat (limited to 'ksh')
-rw-r--r--ksh/kshrc.d/prompt.ksh6
1 files changed, 1 insertions, 5 deletions
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index 99e193b2..4a58f46d 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -20,15 +20,11 @@ function prompt {
# Add sub-commands; working directory with ~ abbreviation, VCS, job
# count, and previous command return value
- PS1=$PS1'$(prompt pwd)$(prompt vcs)$(prompt job)$(prompt ret)'
+ PS1=$PS1'$(ret=$?;prompt pwd;prompt vcs;prompt job;prompt ret)'
# Add prefix and suffix
PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}'
- # Add a wrapper around the prompt as determined so far so that the
- # return value from the previous command doesn't get lost
- PS1='$(ret=$?;printf %s "'"$PS1"'")'
-
# Add terminating "$" or "#" sign
PS1=$PS1'\$'