Input prompt behaves incorrectly if working directory path spans three lines

Bug #1745271 reported by Simon May on 2018-01-25
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Undecided
Unassigned
gnome-terminal (Ubuntu)
Undecided
Unassigned

Bug Description

1) The release of Ubuntu you are using: Ubuntu 17.10

2) The version of the package you are using: gnome-terminal version 3.24.2-0ubuntu4; bash version 4.4-5ubuntu1

3) What you expected to happen: The input prompt should behave the same, no matter what the working directory is.

4) What happened instead: The cursor starts overlapping the working directory text (see attached screenshot, which shows a 80×24 terminal window in a directory called “/home/test/01234567890123456789/01234567890123456789/a/01234567890123456789/01234567890123456789/01234567890123456789/01234567890123456789”).

On text input, the inputted text overwrites the working directory text. When pressing backspace, the entire second line is deleted (including the $ character). This makes using the history (up arrow) very confusing because afterwards, the actual input line characters do not seem to correspond to the displayed text anymore, i.e. characters inserted at a certain point are actually shifted in the resulting line, making it very difficult to properly type in commands.

Simon May (socob) wrote :
Egmont Koblinger (egmont-gmail) wrote :

Does this also happen in xterm? If so then this is a bug in bash, not gnome-terminal.

Simon May (socob) wrote :

Nope, not happening in xterm.

Egmont Koblinger (egmont-gmail) wrote :

I've reproduced your issue (using the exact same prompt string as yours). It's also buggy for me in xterm. I'm pretty sure it's a readline or bash issue.

Simon May (socob) wrote :

Oh, sorry about that. Apparently, xterm uses a different value for PS1 than gnome-terminal by default. It seems that this issue only happens when color escape sequences are involved, which is why it didn’t happen for me in xterm. However, when I manually set xterm to the same value as in gnome-terminal, I also got the issue in xterm.

So, it does seem like a bash issue once again. Thanks for checking!

summary: - Input prompt behaves incorrectly if working directory path spans two
+ Input prompt behaves incorrectly if working directory path spans three
lines
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers