Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable using 'gls' on any OS for ls coloring #4593

Closed
wants to merge 1 commit into from

Conversation

rtimmons
Copy link

@rtimmons rtimmons commented Nov 9, 2015

New adopter to omz. I noticed it had aliased ls to ls --color=tty despite the check to ensure that this doesn't error-out.

In debugging I found that I had already setup ls as an alias alias ls="gls -F --color", so the check passes (since the check uses the aliased ls), and then re-aliases ls and wipes out the gls. Tricky.

At any rate it seems "more correct" to use gls if it's available no matter the OS. I moved the OpenBSD check first to keep the same behavior.

I don't have a NetBSD or OpenBSD to test, but I tried with and without gls installed on my mac and ls is properly aliased and colored.

@mcornella
Copy link
Member

Aliases should be defined after sourcing oh-my-zsh.sh. That's the more direct fix for your problem.

Now, the current logic is a mess. Your problem stems from the fact that the call to ls is done without the command specifier before it, so it uses the ls alias that you defined instead of the original ls command. That is the first problem to fix. The second is to use gls on OSX as well if the normal ls doesn't support coloring.

As is now, I cannot merge this PR. But if you want to apply my suggestions above I'll guide you if you need to. Sorry for the late reply!

@mcornella mcornella added Platform: macOS Issue or PR for macOS Bug Something isn't working Area: core Issue or PR related to core parts of the project Topic: alias Pull Request or issue regarding aliases labels Mar 30, 2016
@mcornella mcornella added the Status: conflicts Pull Request that has conflicts with the master branch label Mar 24, 2019
@robbyrussell
Copy link
Member

⌛️ Closing due to how much time has lapses since feedback was provided

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Issue or PR related to core parts of the project Bug Something isn't working Platform: macOS Issue or PR for macOS Status: conflicts Pull Request that has conflicts with the master branch Topic: alias Pull Request or issue regarding aliases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants