Forwarded on request. This sure has charm ;)
Marcus
- Forwarded message from [EMAIL PROTECTED] -
Delivered-To: [EMAIL PROTECTED]
Subject: Re: ANSI Color Escapes in $PS1.. heh.
To: [EMAIL PROTECTED] (Marcus Brinkmann)
Date: Tue, 8 Dec 1998 00:36:51 -0500 (EST)
From: [EMAIL PROTECTED
On Wed, Dec 02, 1998 at 12:41:06PM -0600, Ryan King wrote:
> Just how stupid an idea did I have when I did this:
>
> $PS1="[\e[31m\h\e[m:\e[34m\u\e[m:\e[31m\w\$\e[m]"
>
> in my /etc/profile?
>
> It looks really nifty until I try to do commands that wrap around, in which
> case the first line ret
Ryan King said
> I don't quite get it... I tried replacing my \e's with ^['s and surrounding
> all escapes with /[/] pairs, and it wouldn't work at all (just the
> "source" were displayed.. IE the same as typing `echo $PS1`)
>
I'm sorry. I wasn't as clear as I should have been.
the two-char ^[ w
[EMAIL PROTECTED] writes:
> How would one check to make sure the terminal is capable of ANSI escape
> sequences?
>
> -brad
I'd do this by not coding in the escape sequences directly, but by using
tput:
export PS1="\[`tput setaf [EMAIL PROTECTED] sgr0`\]:\[`tput setaf 4`\]\w\[`tput
sgr0`\]\$ "
*-"Ryan King" <[EMAIL PROTECTED]>
|
| Just how stupid an idea did I have when I did this:
|
| $PS1="[\e[31m\h\e[m:\e[34m\u\e[m:\e[31m\w\$\e[m]"
|
| in my /etc/profile?
Chuck explained what was going on. Your prompt could be:
PS1="[\[\e[31m\]\h\[\e[m\]:\[\e[34m\]\u\[\e[m\]:\[\e[31m\]\w\[\$\e[m\]
How would one check to make sure the terminal is capable of ANSI escape
sequences?
-brad
On Wed, 2 Dec 1998 [EMAIL PROTECTED] wrote:
> Ryan King said
> > Just how stupid an idea did I have when I did this:
> >
> > $PS1="[\e[31m\h\e[m:\e[34m\u\e[m:\e[31m\w\$\e[m]"
> >
> > in my /etc/profile?
>
Ryan King said
> Just how stupid an idea did I have when I did this:
>
> $PS1="[\e[31m\h\e[m:\e[34m\u\e[m:\e[31m\w\$\e[m]"
>
> in my /etc/profile?
>
Not stupid at all!!
> It looks really nifty until I try to do commands that wrap around, in which
> case the first line returns, but keeps going o
Ryan King wrote:
> Just how stupid an idea did I have when I did this:
>
> $PS1="[\e[31m\h\e[m:\e[34m\u\e[m:\e[31m\w\$\e[m]"
>
> in my /etc/profile?
>
> It looks really nifty until I try to do commands that wrap around, in which
> case the first line returns, but keeps going on the current spot.
Just how stupid an idea did I have when I did this:
$PS1="[\e[31m\h\e[m:\e[34m\u\e[m:\e[31m\w\$\e[m]"
in my /etc/profile?
It looks really nifty until I try to do commands that wrap around, in which
case the first line returns, but keeps going on the current spot.
The real disaster, however, occ
9 matches
Mail list logo