You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Double-completing a relative path with a space in the name and softlinks inside it, results in it being turned into an absolute path.
This breaks attempts at passing relative paths to commands (like is common with ln).
To reproduce
cd /tmp; mkdir TEST; cd TEST
mkdir -p 'aaa/c c' 'aaa/xxx' 'aaa/yyy' bbb
cd 'aaa/c c/'
ln -s ../xxx; ln -s ../yyy
cd ../../bbb
ln -s ../aaa/c and press ⟨TAB⟩ once, to get ../aaa/c\ c/.
Press ⟨TAB⟩ again. And get /tmp/TEST/aaa/c\ c/.
Expected behavior
One should get ../aaa/c\ c/ with xxx/ yyy/
as suggestions.
Versions (please complete the following information)
Operating system name/distribution and version: Linux Mint 21.3 Virginia
It doesn’t happen, if there are no softlinks inside 'c c', of if there is no space in the name of that directory.
But a very similar problem happens for tilde (~). Which needs fixing for the same reason.
Also, I haven’t checked but suspect that if it transforms it like realpath does, turning any softlink component into the real path. (Which also breaks creating softlinks that use these other softlinks to work in several different environments.)
In my case I have several computers all syncing the same directories, but into a different base path since software expects those exact locations. Relative softlinks and softlinks that use other softlinks in their paths are the only way to get all paths to work on all systems. Especially since one of them is a Termux install on Android, where things like bind mounts don’t work, some paths (like pictures) are forcibly somewhere else, and $HOME is very different.
I cannot reproduce the problem. I also tried the combination of the reported versions, Bash-5.1.16 and bash-completion-2.11, but the problem doesn't arise. (edit: I now also tried it in Linux Mint 21.2 because I had a virtual machine, but the problem still doesn't reproduce). The provided trace.log doesn't seem to contain any /tmp/TEST/aaa/c c except the very last line (which is printed by Bash).
What are the result of the following commands (before and after the problem is triggered)?
Describe the bug
Double-completing a relative path with a space in the name and softlinks inside it, results in it being turned into an absolute path.
This breaks attempts at passing relative paths to commands (like is common with
ln
).To reproduce
cd /tmp; mkdir TEST; cd TEST
mkdir -p 'aaa/c c' 'aaa/xxx' 'aaa/yyy' bbb
cd 'aaa/c c/'
ln -s ../xxx; ln -s ../yyy
cd ../../bbb
ln -s ../aaa/c
and press ⟨TAB⟩ once, to get../aaa/c\ c/
./tmp/TEST/aaa/c\ c/
.Expected behavior
One should get
../aaa/c\ c/
withxxx/ yyy/
as suggestions.
Versions (please complete the following information)
echo "$BASH_VERSION"
: 5.1.16(1)-release(IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}")
: 2.11Additional context
It doesn’t happen, if there are no softlinks inside
'c c'
, of if there is no space in the name of that directory.But a very similar problem happens for tilde (
~
). Which needs fixing for the same reason.Also, I haven’t checked but suspect that if it transforms it like
realpath
does, turning any softlink component into the real path. (Which also breaks creating softlinks that use these other softlinks to work in several different environments.)In my case I have several computers all syncing the same directories, but into a different base path since software expects those exact locations. Relative softlinks and softlinks that use other softlinks in their paths are the only way to get all paths to work on all systems. Especially since one of them is a Termux install on Android, where things like bind mounts don’t work, some paths (like pictures) are forcibly somewhere else, and
$HOME
is very different.Debug trace
trace.log
The text was updated successfully, but these errors were encountered: