bug-bash
[Top][All Lists]
Advanced

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

Re: PS1 has ruined line wrap


From: Chet Ramey
Subject: Re: PS1 has ruined line wrap
Date: Thu, 25 Nov 2010 19:26:38 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2

On 11/25/10 3:38 PM, Jonathan Reed wrote:
> I was using this as my ps1
> PS1='[\u@\[\e[1;31m\]\h\[\e[0m\]:$PWD]\$ '
> 
> But I wanted to label the title of my xterm windows with the hostname of
> system Im logged into. So I added the following
> PS1='[\u@\[\e[1;45m\]\h\[\e[0m\] $PWD]\e]2;@ \H\a\$ '
> 
> It works great except for it rewrites the current line if I write text past
> the current window size (regardless of the window size).
> filenameERVERNAME:/home/jreed]$ cat /a/really/long_fi
> 
> Any suggestions?

You might consider bracketing all sequences of non-printing characters
with \[ and \].



-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]