bug-bash
[Top][All Lists]
Advanced

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

Re: prompt with \w incl. long UTF string messes up command line


From: Chet Ramey
Subject: Re: prompt with \w incl. long UTF string messes up command line
Date: Mon, 30 Nov 2015 22:19:54 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/25/15 3:33 AM, Ryo Furue wrote:

> Bash Version: 4.3
> Patch Level: 42
> Release Status: release
> 
> Description:
> When PS1 includes \w and when \w contains long path including UTF
> characters, the cursor position or the command line is messed up.
> 
> Repeat-By:
> 1. Source the attached script:
>   $ . bash-prompt-bug.sh
> 
> 2.1. You'll find the prompt is messed up: shorter than the
>    real path name, garbage character at the top.
> 2.2. If you use the tput commands, which are commented out
>    in bash-prompt-bug.sh, the prompt is fine, but the cursor
>    position is messed up.
> 
> 3. After 2.2, try to complete filenames by pressing TAB,
>   and sometimes you'll find the cursor position is
>   even more badly messed up.

Thanks for the report.  I could not reproduce 2.1 with bash-4.4-beta
(prompt with multibyte characters whose visible length exceeds the screen
width and consequently wraps), but 2.2, which combines that with invisible
characters in the prompt (which need to be included in calculations to
determine cursor position), displays incorrectly.

This will be fixed in the next release of bash.

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]