prezto: ls: illegal option -- -

I have issue using ls command mostly in tmux but It happen sometimes in regular terminal session.

ls: illegal option -- -
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
❯❯❯ zsh --version
zsh --version
zsh 5.1 (x86_64-apple-darwin14.5.0)
❯❯❯ which ls                                                                                                                                                                      ⏎
which ls
ls: aliased to ls --group-directories-first --color=auto

I’m using OSX 10.10.5 and iTterm2 Build 2.9.20150905-nightly but I do not thing that issue is related to terminal emulator.

Thanks for any help.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 15

Commits related to this issue

Most upvoted comments

For reference:

brew install coreutils export PATH=“/usr/local/opt/coreutils/libexec/gnubin:$PATH”

RESOLVED

I have to replace old:

export PATH="$PATH:$(brew --prefix coreutils)/libexec/gnubin"

with new:

export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

THX again

Just checked brew info and found this:

==> Caveats All commands have been installed with the prefix ‘g’.

If you really need to use these commands with their normal names, you can add a gnubin directory to your PATH from your bashrc like:

PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

Additionally, you can access their man pages with normal names if you add the gnuman directory to your MANPATH from your bashrc as well:

MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"

This should work for ZSH/prezto as well. Can you try this and let me know how it goes? 😃

Just bumped into this one in the future, installing coreutils and adding it to the PATH resolved the issue.

I was having this problem but I just found out the solution. On your .zpreztorc file, the one where you load the modules, just load the gnu-utility before the utility module 😃

For reference:

brew install coreutils export PATH=“/usr/local/opt/coreutils/libexec/gnubin:$PATH”

Thanks. That worked!

The problem is in condition

if is-callable 'dircolors'; then

modules/utilitity/init.zsh

function is-callable {
  (( $+commands[$1] )) || (( $+functions[$1] )) || (( $+aliases[$1] ))
}

modules/helper/init.zsh

In my case this should return false but return true instead. I can fix it with redefinig ls alias in my .zshrc file for now.

@turboMaCk I’m guessing you installed coreutils package via brew? If that’s the case, remove the coreutils package and install it again using the following option:

brew install coreutils - - default-names 

Then load the gnu-utility package on your prezto and see if that works. 😃