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

Path csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
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 Fri, 7 Feb 2020 09:06:08 -0500
Lines 34
Approved bug-bash@gnu.org
Message-ID <mailman.431.1581084399.2412.bug-bash@gnu.org> (permalink)
References <CAHO2odAYYC9-yXdo+ekxcxZotC5Jvq8F3NmXS2ysE-7fOU9tLg@mail.gmail.com> <20200207140608.GC1350@eeg.ccf.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1581084400 14611 209.51.188.17 (7 Feb 2020 14:06:40 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To Magnon Damant <mdamant.cs@gmail.com>
Envelope-to bug-bash@gnu.org
Mail-Followup-To Magnon Damant <mdamant.cs@gmail.com>, bug-bash@gnu.org
Content-Disposition inline
In-Reply-To <CAHO2odAYYC9-yXdo+ekxcxZotC5Jvq8F3NmXS2ysE-7fOU9tLg@mail.gmail.com>
User-Agent Mutt/1.10.1 (2018-07-13)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 139.137.100.1
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <20200207140608.GC1350@eeg.ccf.org>
X-Mailman-Original-References <CAHO2odAYYC9-yXdo+ekxcxZotC5Jvq8F3NmXS2ysE-7fOU9tLg@mail.gmail.com>
Xref csiph.com gnu.bash.bug:15873

Show key headers only | 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