zsh-workers
 help / color / mirror / code / Atom feed
* Good documentation about literal escape sequences in prompt?
@ 2000-03-11 23:41 Juhapekka Tolvanen
  2000-03-11 23:55 ` Adam Spiers
  2000-03-12  0:05 ` Bart Schaefer
  0 siblings, 2 replies; 7+ messages in thread
From: Juhapekka Tolvanen @ 2000-03-11 23:41 UTC (permalink / raw)
  To: zsh-workers


%{...%}
        Include a string as a literal escape sequence. The
        string within the braces should not change the cursor
        position. Brace pairs can nest.

Hey, come on! Do you really think that is enough? Why don't you provide some
good examples? I know you can do it better!

For example this does not work:

PS1="%{\e[1;31m%}$PS1%{\e[1m%}"

Just look, what i get:

Normally my PS1 is like this:

1510 | p5 | juhtolv@heresy : /home/juhtolv/apu
% 

If I say this:

PS1="%{\e[1;31m%}$PS1%{\e[1m%}"

I get this:

[1;31m$PS1"\e[1;31m1538 | p6 | juhtolv@heresy : /home/juhtolv
% \e[1m

Color-codes were found from /usr/share/zsh/functions/colors

I tried to understand other files in /usr/share/zsh/functions, like _prompt
and promptinit but even it was the real pain in the ass.

So meanwhile I have to use really ugly hacks like these:

PS1="`print -Pn '\e[1;31m'`$PS1 `print -Pn '\e[0m'`"

PS1="`print -Pn '\e[1;31m'``print -Pn '\e[1;43m'`$PS1`print -Pn '\e[0m'`"

-- 
-- Juhapekka "naula" Tolvanen * * * U of Jyväskylä * * juhtolv@st.jyu.fi --
-- http://www.cc.jyu.fi/~juhtolv/ * * * * " STRAIGHT BUT NOT NARROW !! " --
---------------------------------------------------------------------------
"I don't want to run a company. I'm not good at managing people. You have
a problem with the guy in the next cubicle? I don't care. Shoot him or
something." Marc Andreessen, founder of Netscape, in Rolling Stone, May '97


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-03-12 19:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-11 23:41 Good documentation about literal escape sequences in prompt? Juhapekka Tolvanen
2000-03-11 23:55 ` Adam Spiers
2000-03-12  0:05 ` Bart Schaefer
2000-03-12 17:35   ` Juhapekka Tolvanen
2000-03-12 18:19     ` Oliver Kiddle
2000-03-12 19:34       ` Juhapekka Tolvanen
2000-03-12 18:37     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).