zsh-users
 help / color / mirror / code / Atom feed
* prompt quoting question
@ 2001-08-27  4:49 Russell Hoover
  2001-08-27  7:50 ` Preben Guldberg
  2001-08-27  8:06 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Russell Hoover @ 2001-08-27  4:49 UTC (permalink / raw)
  To: zsh-users

I have a right-prompt string:

export RPS1="%{$(print -n '\e[1;34m')%} `/usr/bin/tty | sed -e 's/\/dev\/tty//'`  \
%{$(print -n '\e[1;32m')%}%D{%A  %Y/%m/%d  %T} %{$(print -n '\e[m')%}"

which works fine, creating:

                                     r8  Monday  2001/08/27  00:29:49


where the tty (r8) is blue and the rest is green.  But this is the old style
of creating colors.  With the new, I know I need something like:

export RPS1=$'%{\e[1;34m%} tty  %{\e[1;32m%}%D{%A  %Y/%m/%d  %T} %{\e[m%}'

But when I replace "tty" in the line above with `/usr/bin/tty | sed -e 's/\/dev\/tty//'`
instead of displaying the tty number, the prompt is messed up:

                 \e[1;32mMonday  2001/08/27  00:14:45 \e[mv

and sed gives me an error message:

                 sed: 1: "s//dev/tty//": bad flag in substitute command: 't'

It seems to me the problem is in correctly quoting the 's/\/dev\/tty//' : the
single quotes (within backtics within single quotes) won't cut it.  Any clues
appreciated.

-- 
                                 // rj@panix.com //


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

end of thread, other threads:[~2001-08-27  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-27  4:49 prompt quoting question Russell Hoover
2001-08-27  7:50 ` Preben Guldberg
2001-08-27  8:06 ` 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).