Subject: bash: Cannot ls/cd into a directory with special chars

From: Helge Kreutzmann <[email-masked]>
Date: Sun, 9 Jun 2024 13:37:52 +0000

Package: bash
Version: 5.2.21-2+b1
Severity: minor

If I run "ls" in a certain diretory, I get:
…                                                   …                                                              Jean-Michel_Jarre-Oxygène_3         Jean-Michel_Jarre-Oxymore.3D            …
Jean-Michel_Jarre-Electronica_1_The_Time_Machine    …                                                              …                                   …
Jean-Michel_Jarre-Electronica_2_The_Heart_of_Noise  …                                                              …                                   …
Jean-Michel_Jarre-Equinoxe                          …                                                              …                                   Jean-Michel_Jarre-Zoolook

Here "…" are other directories not relevant for this bug report.

Now I enter "ls" (or cd) and copy & paste (with gpm) "Jean-Michel_Jarre" at the prompt and press tab 3x:

helge@twentytwo:$ ls Jean-Michel_Jarre
Jean-Michel_Jarre-Electronica_1_The_Time_Machine/
Jean-Michel_Jarre-Equinoxe/
Jean-Michel_Jarre-Zoolook/
Jean-Michel_Jarre-Electronica_2_The_Heart_of_Noise/
Jean-Michel_Jarre-Oxymore.3D/

As you can see, "Jean-Michel_Jarre-Oxygène_3" is not listed.

If I copy and paste the full name, it does not work either:
helge@twentytwo:$ ls Jean-Michel_Jarre-Oxygène_3
ls: Zugriff auf 'Jean-Michel_Jarre-Oxygène_3' nicht möglich: Datei oder Verzeichnis nicht gefunden
helge@twentytwo:$ cd Jean-Michel_Jarre-Oxygène_3
-bash: cd: Jean-Michel_Jarre-Oxygène_3: Datei oder Verzeichnis nicht gefunden

It says "File or directory not found"

Permissions etc. are alright, using mc(1) or cmus(1) I can access the directory Jean-Michel_Jarre-Oxygène_3 without problems

-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to de_DE.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bash depends on:
ii  base-files   13.2
ii  debianutils  5.18
ii  libc6        2.38-12
ii  libtinfo6    6.5-2

Versions of packages bash recommends:
ii  bash-completion  1:2.14.0-1

Versions of packages bash suggests:
pn  bash-doc  <none>

-- no debconf information

-- 
      Dr. Helge Kreutzmann                     [email-masked]
           Dipl.-Phys.                   http://www.helgefjell.de/debian.php
        64bit GNU powered                     gpg signed mail preferred
           Help keep free software "libre": http://www.ffii.de/