#538891 bash: completion incorrect with symlinks

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Peter Dillinger
Date:
2024-06-03 15:15:03 UTC
Severity:
normal
Tags:
#538891#5
Date:
2009-07-27 18:50:55 UTC
From:
To:
peterd@naxos:~/tmp$ mkdir foo
peterd@naxos:~/tmp$ mkdir bar
peterd@naxos:~/tmp$ cd bar
peterd@naxos:~/tmp/bar$ mkdir baz
peterd@naxos:~/tmp/bar$ ln -s ../foo foo
peterd@naxos:~/tmp/bar$ cd foo
peterd@naxos:~/tmp/bar/foo$ ls ../ba
  Hit Tab, completes incorrectly:
peterd@naxos:~/tmp/bar/foo$ ls ../baz
ls: cannot access ../baz: No such file or directory
peterd@naxos:~/tmp/bar/foo$ cd ../ba
  Hit Tab, does not offer any completion.  Must type explicitly:
peterd@naxos:~/tmp/bar/foo$ cd ../baz
peterd@naxos:~/tmp/bar/baz$

So not only does it offer the wrong completion for `ls`, but it fails to
offer that completion for `cd`, for which it would be correct!

(Actually, it seems to offer the completion for `cd` if you have not
sourced /etc/bash_completion, but does not if you have sourced
/etc/bash_completion.)

This bug has been around for a long time, and I keep expecting it to get
fixed because it is so glaring.  Needs reporting I guess.

#538891#10
Date:
2010-01-06 12:54:01 UTC
From:
To:
https://launchpad.net/bugs/503761
should be the same issue.