[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: BASH BUG



You need to indicate which characters don't print so that bash can
calculate the line length correctly. Try the "PROMPTING" section in
the bash manpage.

PS1='\h \w \$ \[\033]0;\h \w\007\]'  # set xterm title/icon
#             \[                \]   surround non-printing chars

This type of question should be on debian-user in the future.

On Mon, Nov 22, 1999 at 01:23:42PM +0100, Juli-Manel Merino Vidal wrote:
> Hi all,
> 
> try the following PS1 (for root) and notice what happens:
> 	export PS1='^[[1m^[[31m\h:\w\$^[[0m '
> 
> ^[ are scape secuences... This PS1 is red and shows the hostname and
> the path.
> Or try other scape secuences.
> 
> Before you reach the end of the line, bash jump to the start of it...
> and when you go back, it goes two lines above. Try it ! It's really
> annoying.
> 
> Bye.
> 

-- 
Lee Bradshaw                 lee@sectionIV.com (preferred)
Alantro Communications       lee@alantro.com


Reply to: