Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd: paths via '../' are not completed if cwd is a symlink #118

Closed
mgorny opened this issue Apr 18, 2017 · 3 comments
Closed

cd: paths via '../' are not completed if cwd is a symlink #118

mgorny opened this issue Apr 18, 2017 · 3 comments

Comments

@mgorny
Copy link
Contributor

mgorny commented Apr 18, 2017

Let's say I have three directories, /a, /a/foo and /b, plus a symlink /b/foo that points to /a/foo. Now, if I'm in /b/foo (i.e. the path referencing a directory symlink), cd completion seems to insist on 'returning' to the current directory, i.e. if I type cd ../ and push tab, I get cd ../foo even though both /a and /b contain other directories. Starting to type a name of one of the directories in either of those directories doesn't trigger any completion.

AFAICS, the cd behavior in bash is a bit weird. cd .. goes to the apparent parent directory (i.e. strips last path component) but cd ../something can either go into a subdirectory of the apparent parent directory (i.e. /b), or a subdirectory of the 'physical' parent directory (/a). It would be nice if bash completion accounted for that, and completed both paths appropriately.

Please also note that cd has a -P switch that forces using 'physical' parent directory, i.e. the expected system behavior.

@weikinhuang
Copy link

Has there been any progress on this issue?

@scop
Copy link
Owner

scop commented Apr 21, 2019

No, but I just had a look. It's a direct result of bash's compgen -d behavior, so it should be addressed in bash itself, reported: http://lists.gnu.org/archive/html/bug-bash/2019-04/msg00135.html

@scop scop closed this as completed Apr 21, 2019
@scop
Copy link
Owner

scop commented Apr 25, 2019

Hm, I'm quite likely a bit confused about the issue and did not read the report carefully enough, closing it may have been a bit premature. Reopening for another look sometime.

Meanwhile, upstream replied: http://lists.gnu.org/archive/html/bug-bash/2019-04/msg00151.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants