bug-bash
[Top][All Lists]
Advanced

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

Re: Input line of a terminal is messed and broken


From: Chet Ramey
Subject: Re: Input line of a terminal is messed and broken
Date: Sun, 15 Apr 2012 17:13:10 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 4/15/12 9:21 AM, "유병석(Byeongseok Yu)" wrote:

> Bash Version: 4.2
> Patch Level: 24
> Release Status: release
> 
> Description:
> Input line is messed and broken.
> 
> Repeat-By:
> 1. $export PS1=\e[34;40m[\u@\h \w]\e[m
> 2. #cd subfolders successively until PS1 echoes go over the half portion
> of input line of a terminal screen width.
> 3. $ls <tab> # key to show up the file candidates.
> 4. You will see abnormal display - something like wrapping-around to the
> beginning position

You forgot to use \[ and \] to bracket sequences of non-printing
characters in the prompt.  If you don't indicate which characters don't
take up any screen space, readline miscalculates the length of the
prompt and the location of the cursor on the screen.

Chet
-- 
``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]