change to a directory containing \ results in glitched up terminal that cannot be reset

Bug #128466 reported by Tama00
8
Affects Status Importance Assigned to Milestone
bash (Debian)
Fix Released
Unknown
bash (Ubuntu)
Fix Released
Low
Rolf Leggewie

Bug Description

Open a terminal and type:

mkdir test;
mkdir test/c\\c;
cd test/c\\c

results in corrupted terminal display eg
]0;tama@Volatile: ~/test/ctama@Volatile:~/test/c\c$

with the cursor being on the line below it.

and for fun try typing reset and hitting enter to see that it wont fix it :o

Revision history for this message
Andrew Ash (ash211) wrote :

Just for the record, I cannot reproduce this on Mac OS X 10.4.10's bash: 2.05b.0(1)-release

Revision history for this message
era (era) wrote :

I'm on Gutsy, and I managed to follow the repro steps. For me, it simply looked like the prompt was hanging, but once I typed a command and hit Enter, it executed, and revealed the previous prompt when the window scrolled.

era@indeed:~$ mkdir -p /tmp/test/c\\c
era@indeed:~$ cd /tmp/test/c\\c
<U+001B>]0;era@indeed: /tmp/test/cera@indeed:/tmp/test/c\c$ ech ohellos
bash: ech: command not found
<U+001B>]0;era@indeed: /tmp/test/cera@indeed:/tmp/test/c\c$ echo hellos
hellos
<U+001B>]0;era@indeed: /tmp/test/cera@indeed:/tmp/test/c\c$ cd -
/home/era
era@indeed:~$ cd -
/tmp/test/c\c
<U+001B>]0;era@indeed: /tmp/test/cera@indeed:/tmp/test/c\c$ cd -
/home/era
era@indeed:~$ bash --version
GNU bash, version 3.2.25(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
era@indeed:~$

Changed in bash:
status: New → Confirmed
Revision history for this message
era (era) wrote :

For the record, switching back to my home directory fixed it for me. It's only hosed as long as you are in a directory which contains the backslash (and. apparently, your $PROMPT_COMMAND is set to attempt to print it).

era@indeed:~$ echo $PROMPT_COMMAND
echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
era@indeed:~$ unset PROMPT_COMMAND
era@indeed:~$ cd -
/tmp/test/c\c
era@indeed:/tmp/test/c\c$ cd - # look ma, no display problems
/home/era
era@indeed:~$

Revision history for this message
era (era) wrote :

Personally, I would revert the use of PROMPT_COMMAND in favor of simply embedding the xterm title-changing stuff in PS1 proper. I don't have any insight into why this is implemented this way, though (however, ISTR that this used to be all handled in PS1 back in some primordial version of Debian).

Tangentially, see also, perhaps, bug 116226

Mika Fischer (zoop)
Changed in bash:
importance: Undecided → Low
status: Confirmed → Triaged
Revision history for this message
Rolf Leggewie (r0lf) wrote :

There hasn't been any activity in this ticket for a while. Is this still a problem in Jaunty or Karmic?

Changed in bash (Ubuntu):
status: Triaged → Incomplete
assignee: nobody → Rolf Leggewie (r0lf)
Revision history for this message
era (era) wrote :

Jaunty no longer seems to be using PROMPT_COMMAND so it appears that the suggestion in comment #4 was implemented. Debian bug #420656 is indicated in the Changelog as an upstream equivalent; fixed in Debian bash 3.2-2

Changed in bash (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Thank you for reporting back and closing this ticket.

Changed in bash (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.