Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PROMPT escape sequences
- X-seq: zsh-users 11951
- From: Atom Smasher <atom@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: PROMPT escape sequences
- Date: Mon, 8 Oct 2007 12:27:37 +1300 (NZDT)
- In-reply-to: <071007103242.ZM23816@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Openpgp: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt
- References: <20071007103407.33577.qmail@xxxxxxxxxxx> <071007103242.ZM23816@xxxxxxxxxxxxxxxxxxxxxx>
On Sun, 7 Oct 2007, Bart Schaefer wrote:
So the answer to this question is:
} is there a way to set a color at the prompt that doesn't reset to default
} when i tab-complete?
No, there isn't, because you're relying on the entire prompt being re-
painted every time zsh needs to redraw the line that begins with the
prompt, but ZLE is optimized to use cursor motions and only redraw the
bits of the line that actually need changing. It has no idea what the
color settings are at any given position on the terminal, so it can't
restore color; it only knows what the non-zero-width characters are.
===================
this gets me very close:
expand-or-complete () {
PREDISPLAY=${fg[cyan]}
zle .expand-or-complete
}
zle -N expand-or-complete
but it doesn't output any escape characters... just the text string
"^[[36m" as if there's an implied ${(V)fg[cyan]}. what do i need to do to
make that output a literal escape sequence? why doesn't it work that way
by default?
i also tried including "reset-prompt" within the redefined
"expand-or-complete", but didn't have any luck with that. i thought that
in re-displaying the prompt, it would also re-colorize the text typed at
the prompt, but apparently it doesn't.
--
...atom
________________________
http://atom.smasher.org/
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------
"I never did give them hell. I just told the truth,
and they thought it was hell."
-- Harry S Truman, 3 Apr 1956
Messages sorted by:
Reverse Date,
Date,
Thread,
Author