I am using tcsh. I found that when I do
scp my
tab, it doesn't autocomplete to my-file.txt
under the current directory
I have to prefix a ./
there to make it complete.
This seems to only happen with scp
. I tried other commands, it seems to work fine.
I find that scp
tab gives me
the value of of $HOSTNAME
(i.e. the current hostname) localhost
So it looks like it's trying to match the hostname, don't know why..
added in response to comment:
~/temp/test>ls -al
total 12
drwxr-xr-x 2 liw liw 4096 Jul 21 15:16 .
drwxr-xr-x 9 liw liw 8192 Jul 21 15:15 ..
-rw-r--r-- 1 liw liw 0 Jul 21 15:16 my_file.txt
~>more .cshrc.user
set prompt="%n@%m %~%#"
set path=($HOME/bin $path)
if (-o $HOME/.aliases) source $HOME/.aliases
set filec
set autolist
set autoexpand
set addsuffix
bindkey ^r i-search-back
~> complete scp
'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");ssh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");ssh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@' 'n/*/$hosts/:'
~/.tcshrc
or~/.cshrc
./my[TAB]
wouldn't work any better.