Re: SOLVED: Problem with /usr/X11R6/bin/xterm
Re: SOLVED: Problem with /usr/X11R6/bin/xterm
- Subject: Re: SOLVED: Problem with /usr/X11R6/bin/xterm
- From: Viv Kendon <email@hidden>
- Date: Tue, 7 Dec 2010 22:59:34 +0000 (GMT)
On Tue, 7 Dec 2010, Ambrose LI wrote:
2010/12/7 Cook, Rich <email@hidden>:
interesting that they have a special syntax in the prompt string to tell the
shell "these are non printing characters," as if the shell is not able to
divine that. Perhaps that's the best solution.
Indeed, the shell is not able to divine that, since you never know how
your particular terminal responds to control characters. Not all
terminals are ANSI, not all ANSI terminals use the same control
sequences. And may not always be able to supply a 100% correct $TERM,
or the corresponding terminfo might not 100% describe all possible
control sequences (and frequently they do not). So even if the shell
were to parse the prompt for possible control characters it still
could miss some, so what bash does here is "trust the user, who should
know best".
--
cheers,
-ambrose
...and for that reason I test $TERM and only set a bold
prompt if it is a type I know supports the codes I'm using.
Thanks for the \[ \] info too, spacing now works perfectly!
This is why I hang around on these lists :)) I prefer bold
to colour because I use different colour backgrounds to
distinguish xterms with different functions. Just personal
preference...
-- Viv
________________________________________________
Dr Viv Kendon http://quantum.leeds.ac.uk/~viv
tel: +44 113 343 4864 Physics and Astronomy
Quantum Information Group University of Leeds
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden