Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11937

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

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: prompt with \w incl. long UTF string messes up command line
Date 2015-11-30 22:19 -0500
Organization ITS, Case Western Reserve University
Message-ID <mailman.1074.1448940005.31583.bug-bash@gnu.org> (permalink)
References <CAGKoo-yvVMR3Oy81ENDwZa4w5Smr6wx9euB_Dkr3ELtGOdF_5g@mail.gmail.com>

Show all headers | View raw


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/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: prompt with \w incl. long UTF string messes up command line Chet Ramey <chet.ramey@case.edu> - 2015-11-30 22:19 -0500

csiph-web