Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: PROMPT_SP
- X-seq: zsh-workers 21508
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: PROMPT_SP
- Date: Sat, 23 Jul 2005 10:19:55 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <20050723165301.GB16571@xxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20050714182506.GB11296@xxxxxxxxx> <20050715175551.GA29713@xxxxxxxxx> <1050716160634.ZM31049@xxxxxxxxxxxxxxxxxxxxxxx> <20050716195612.GA11575@xxxxxxxxx> <200507181032.j6IAWB4q022520@xxxxxxxxxxxxxx> <20050718181330.GA19066@xxxxxxxxx> <1050723135554.ZM19813@xxxxxxxxxxxxxxxxxxxxxxx> <20050723165301.GB16571@xxxxxxxxx>
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