Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: PROMPT_SP



On Sat, Jul 23, 2005 at 09:53:01AM -0700, Wayne Davison wrote:
> That puts a standout-string "[EOL]" at the end of the output.

Here's a potential patch for FAQ.yo if folks like the idea.  I
made the text bold too (if possible) and switched to using print
with prompt expansion.

..wayne..
--- Etc/FAQ.yo	19 Jul 2005 15:18:11 -0000	1.22
+++ Etc/FAQ.yo	23 Jul 2005 17:16:34 -0000
@@ -1664,13 +1664,13 @@ sect(How do I prevent the prompt overwri
     # Skip defining precmd if the PROMPT_SP option is available.
     if ! eval '[[ -o promptsp ]] 2>/dev/null'; then
       function precmd {
+        print -nP '%B%S[EOL]%s%b'
         # An efficient version using termcap multi-right:
-        echo -n ' '       # Output 1 space
-        echotc RI $((COLUMNS - 3))
+        echotc RI $((COLUMNS - 7))
         echo -n '  '      # Output 2 spaces
-        # Alternately, try replacing the above 3 lines with this echo
-        # that outputs a screen-column-width of spaces:
-        #echo -n ${(l:$COLUMNS:::):-}
+        # Alternately, try replacing the above 2 lines with this echo
+        # that pads the line with spaces:
+        #echo -n ${(l:$((COLUMNS-5)):::):-}
       }
     fi
   )


Messages sorted by: Reverse Date, Date, Thread, Author