aboutsummaryrefslogtreecommitdiff
path: root/ksh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-27 13:37:43 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-27 13:37:43 +1300
commitb23381428dad76fb4d7020b5e3bc1e743cf58196 (patch)
treec54e421b12ab2e4095d067473f8b4f3f4b8aff02 /ksh
parent47f9cd27b2894bb3573083446db63dc7d2a968fe (diff)
downloaddotfiles-b23381428dad76fb4d7020b5e3bc1e743cf58196.tar.gz
Preserve job count quickly for ksh
Diffstat (limited to 'ksh')
-rw-r--r--ksh/kshrc.d/prompt.ksh4
1 files changed, 1 insertions, 3 deletions
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index 063f5210..e082d600 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -20,7 +20,7 @@ function prompt {
# Add sub-commands; working directory with ~ abbreviation, VCS, job
# count, and previous command return value
- PS1=$PS1'$(ret=$?;prompt pwd;prompt vcs;prompt job;prompt ret)'
+ 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}'
@@ -192,8 +192,6 @@ function prompt {
# Show the count of background jobs in curly brackets, if not zero
job)
- typeset -i jobc
- jobc=$(jobs -p | sed -n '$=')
((jobc)) && printf '{%u}' "$jobc"
;;