Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Giving "ls" an alias causing completion problems



On Aug 22,  1:31pm, Ismail Donmez wrote:
} 
} [~]> zsh --version
} zsh 5.0.2 (x86_64-suse-linux-gnu)
} 
} 
} # When ls is not aliased, life is good
} # Pressing tab switches between completions
} 
} [~]> alias ls
} ls=_ls

You say "not aliased" but this sample makes it appear that ls *has*
been aliased, possibly to the completion function for itself.  If it
were not aliased, you should see no output.  What are you actually
trying to demonstrate there?

If the above really is the output from that command, then in your first
sample of tab-completion you are not getting completions for "ls", you
are getting completions for "_ls", which probably means just the file
defaults.

However, if the above really is the output, then you likely have a
deeper problem happening somewhere and I'd distrust anything further
until you figure out how you got that strange alias in the first place.

} # Giving ls an alias pressing tab key shows all results on one line
} 
} [~]> alias ls="ls --color"
} [~]> ls <tab> bin  config  Desktop  Documents  Downloads  hacks
}  public_html  rpmbuild
} <tab> bin  config  Desktop  Documents  Downloads  hacks  public_html
}  rpmbuild

Are the results actually being inserted into the command line where
you can edit them, or by "shows all results" do you mean that the
listing display which normally appears below the command line has
instead been displayed in the wrong place and wrong format?

What do you see if you type <ctrl+x h> instead of <tab>?  Normally it
would be something very similar to this:

torch% alias ls='ls --color'
torch% ls 
tags in context :completion::complete:ls::
    argument-rest options  (_arguments _ls)
tags in context :completion::complete:ls:argument-rest:
    all-files  (_files _arguments _ls)



Messages sorted by: Reverse Date, Date, Thread, Author