rc
rc copied to clipboard
Command completion often skips files in the current directory when you use './cm<tab>'
If you build the latest git version with --with-edit=readline
, you get command completion and the command completion handles 'dir/cmd' in the same way that rc's $path
does, which is great. However, it appears to mishandle completion for './cm.
is not on your $path. You don't get completions for things in the current directory until you type enough that nothing in $path matches, and under some circumstances you can complete a unique name in your $path.
; echo $version
1.7.4 $Release: @(#)rc 1.7.4 v1.7.4-91-g9d071b2 $
; path=(/usr/bin /usr/sbin)
; ls -l ./bootstrap
-rwxr-xr-x 1 cks cks 226000 Jul 27 14:33 ./configure*
In this setup, typing ./boo<TAB>
gets a completion to ./bootctl
. If you actually try to use this, of course, it doesn't work.
Putting .
on $path at least makes ./bootstrap
show up in the completion, but rc still offers ./bootctl
as well and will still complete to it as well.
I'd be happy to test patches and changes for this. (I took a brief look at the code involved and nothing obvious stood out to me.)
Thanks @siebenmann
I guess we'll need to treat ./
and ../
specially. I'll get that sorted soon.
There's a handy isabsolute()
in utils.c
which does just the job we need.
I have a code fix or workaround for this that appears to work for me and be stable (now linked to above). I can turn it into a pull request if it looks good, or iterate on it for a better fix, depending on what you think about it.
Fixed.