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


Groups > gnu.bash.bug > #15873

Re: Opening a `.HFS+ Private Directory Data'$'\r` folder messes up terminal prepended prompt

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: Opening a `.HFS+ Private Directory Data'$'\r` folder messes up terminal prepended prompt
Date 2020-02-07 09:06 -0500
Message-ID <mailman.431.1581084399.2412.bug-bash@gnu.org> (permalink)
References <CAHO2odAYYC9-yXdo+ekxcxZotC5Jvq8F3NmXS2ysE-7fOU9tLg@mail.gmail.com> <20200207140608.GC1350@eeg.ccf.org>

Show all headers | View raw


On Fri, Feb 07, 2020 at 05:11:43PM +1000, Magnon Damant wrote:
> I noticed a bug where when I open a Time Machine Backup folder (called .HFS+
> Private Directory Data'$'\r) the terminal cursor position gets messed up.

"Open" is a bit ambiguous here....

> prompt [<user>@<hostname>
> <folder>]$ gets messed up
> 
> I guess the '$'\r name ending is causes the issue [maybe not escaped
> properly?].
> Prepended prompt should display [something like]:
> [magnon@magnon-desktop .HFS+ Private Directory Data^M]$

So, by "open", you mean "cd into".

wooledg:~$ mkdir $'crtest\r'
wooledg:~$ cd crtest^M/
$ oledg:~/crtest

Line 2 was generated by tab completion, not by typing caret-shift-M.

The carriage return in the directory name is simply being printed
literally to the terminal by the prompt.  It's not escaped, which
is why it looks like this.

I'm not sure I'd call this a bug -- more of a feature request, for
bash to present control characters in directory names (or partial
names), that are expanded from PS1, in an escaped form.

Meanwhile, I strongly advise you to rename this directory so that
it doesn't end with a carriage return.  This won't be the only
problem it causes you.

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


Thread

Re: Opening a `.HFS+ Private Directory Data'$'\r` folder messes up terminal prepended prompt Greg Wooledge <wooledg@eeg.ccf.org> - 2020-02-07 09:06 -0500

csiph-web