zsh-users
 help / color / mirror / code / Atom feed
* Giving "ls" an alias causing completion problems
@ 2013-08-22 10:31 İsmail Dönmez
  2013-08-22 14:32 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: İsmail Dönmez @ 2013-08-22 10:31 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]

Hi,

[~]> 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

[~]> ls <tab> bin/
bin/          config/       Desktop/      Documents/    Downloads/
 hacks/        public_html/  rpmbuild/

# 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Giving "ls" an alias causing completion problems
  2013-08-22 10:31 Giving "ls" an alias causing completion problems İsmail Dönmez
@ 2013-08-22 14:32 ` Bart Schaefer
  2013-08-22 14:54   ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2013-08-22 14:32 UTC (permalink / raw)
  To: Ismail Donmez, zsh-users

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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Giving "ls" an alias causing completion problems
  2013-08-22 14:32 ` Bart Schaefer
@ 2013-08-22 14:54   ` Bart Schaefer
  2013-08-23 10:37     ` İsmail Dönmez
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2013-08-22 14:54 UTC (permalink / raw)
  To: Ismail Donmez, zsh-users

Hang on a moment ...

On Aug 22,  7:32am, Bart Schaefer wrote:
}
} On Aug 22,  1:31pm, Ismail Donmez wrote:
} } 
} } [~]> 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.

Do you actually have a function named "_ls" that is defined in your
zsh startup files?

That function name will conflict with the name of the completion function
used for "ls" completions.  Names starting with a single underscore are 
assumed to be "reserved" for the completion system.

In fact ...

torch% _ls() { ls }
torch% ls Config          config.log      config.modules.sh  Doc  Makefile
stamp-h
config.h  config.modules  config.status      Etc  Src       Test               
torch% 

Yep, that's almost certainly what's going on here.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Giving "ls" an alias causing completion problems
  2013-08-22 14:54   ` Bart Schaefer
@ 2013-08-23 10:37     ` İsmail Dönmez
  0 siblings, 0 replies; 4+ messages in thread
From: İsmail Dönmez @ 2013-08-23 10:37 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

Hi,


On Thu, Aug 22, 2013 at 5:54 PM, Bart Schaefer <schaefer@brasslantern.com>wrote:

> Hang on a moment ...
>
> On Aug 22,  7:32am, Bart Schaefer wrote:
> }
> } On Aug 22,  1:31pm, Ismail Donmez wrote:
> } }
> } } [~]> 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.
>
> Do you actually have a function named "_ls" that is defined in your
> zsh startup files?
>

Yep that was it, a file under /etc/profile.d was setting up a function
named _ls and aliasing it to ls. Renamed it to z_ls and problem fixed.

Thanks  a lot!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-23 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-22 10:31 Giving "ls" an alias causing completion problems İsmail Dönmez
2013-08-22 14:32 ` Bart Schaefer
2013-08-22 14:54   ` Bart Schaefer
2013-08-23 10:37     ` İsmail Dönmez

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).