Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
command substitution with control chars?
- X-seq: zsh-users 11332
- From: Atom Smasher <atom@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: command substitution with control chars?
- Date: Sun, 25 Mar 2007 05:44:10 -0400 (EDT)
- 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
i'm trying to have part of a dynamic prompt that displays in different
colors depending on system parameters.
the output of the script starts with some control characters to set the
text colors, then outputs some colored text from a script, then outputs
^[[0m to return to normal colors.
if i run the script in precmd() it ~almost~ works 100%... except that the
end of the prompt may be hosed by tab-expansion or command line editing
(since the control characters aren't properly counted in the width of the
prompt). also, this is limited to only having the output of the script at
the beginning of the line, although for now that is where i want it.
i suspect the better way to do this would be command substitution in the
prompt, but the control chars seem to really be making a mess out of that.
any suggestions?
thanks...
--
...atom
________________________
http://atom.smasher.org/
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------
"You don't get everything you want. A dictatorship would
be a lot easier."
-- George "dubya" Bush, describing what it's like
to be governor of Texas. (Governing Magazine 7/98)
"If this were a dictatorship, it would be a heck of a lot
easier, just so long as I'm the dictator."
-- George "dubya" Bush
http://www.cnn.com/TRANSCRIPTS/0012/18/nd.01.html
18 Dec 2000 CNN.com
"A dictatorship would be a heck of a lot easier, there's
no question about it."
George "dubya" Bush, 27 Jul 2001 Associated Press
Messages sorted by:
Reverse Date,
Date,
Thread,
Author