about summary refs log tree commit diff
path: root/Functions/Prompts/prompt_bart_setup
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Prompts/prompt_bart_setup')
-rw-r--r--Functions/Prompts/prompt_bart_setup11
1 files changed, 7 insertions, 4 deletions
diff --git a/Functions/Prompts/prompt_bart_setup b/Functions/Prompts/prompt_bart_setup
index b1a90e51c..c09ec64df 100644
--- a/Functions/Prompts/prompt_bart_setup
+++ b/Functions/Prompts/prompt_bart_setup
@@ -31,8 +31,8 @@ prompt_bart_help () {
 	nonzero, or underlined if the job was stopped.
 
 	If the last command is too wide to fit without truncating the
-	current directory, it is put on a line by itself.  The current
-	directory uses %~, so namedir abbreviation applies.
+	current directory, it is put on a middle line by itself.  The
+	current	directory uses %~, so namedir abbreviation applies.
 
 	The "upper right prompt" looks like:
 	    date time
@@ -81,8 +81,11 @@ prompt_bart_precmd () {
     # Reset the truncation widths for upcoming computations
     ((PSCOL == 1)) || { PSCOL=1 ; prompt_bart_ps1 }
     if [[ -o promptcr ]]
-    then print -nPu 2 "${(l.COLUMNS.. .)}\e[s${(pl.COLUMNS..\b.)}%E\e[u"
-    else IFS='[;' read -s -d R escape\?$'\e[6n' lineno PSCOL
+    then
+        # Emulate the 4.3.x promptsp option if it isn't available
+        eval '[[ -o promptsp ]] 2>/dev/null' ||
+            print -nP "${(l.COLUMNS.. .)}\e[s${(pl.COLUMNS..\b.)}%E\e[u" >$TTY
+    else IFS='[;' read -s -d R escape\?$'\e[6n' lineno PSCOL <$TTY
     fi
     ((PSCOL == 1)) || prompt_bart_ps1
     ((colno = COLUMNS-PSCOL))