From 90dcadfb2e6e82b7d5e9bdbac2c109433f70caf7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 27 Dec 2016 02:26:00 +1300 Subject: Realised easy win avoiding subshells And also the PROMPT_RETURN fudge in Bash/Zsh --- ksh/kshrc.d/prompt.ksh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'ksh') 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'\$' -- cgit v1.2.3