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

Feature request to make gls work on macos with coreutils #1758

Open
GiHutb opened this issue Nov 7, 2019 · 2 comments · May be fixed by #1786
Open

Feature request to make gls work on macos with coreutils #1758

GiHutb opened this issue Nov 7, 2019 · 2 comments · May be fixed by #1786

Comments

@GiHutb
Copy link

GiHutb commented Nov 7, 2019

After installing coreutils via below command

$> brew install coreutils

'gls' and 'gdircolors' are available. So if I do below colors and directory dirs-first is working.

$> git diff
diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh
index a2e5c2b..4400cf0 100644
--- a/modules/utility/init.zsh
+++ b/modules/utility/init.zsh
@@ -73,6 +73,12 @@ if zstyle -T ':prezto:module:utility' safe-ops; then
 fi

 # ls
+
+if is-callable 'gdircolors'; then
+  alias dircolors='gdircolors'
+  alias ls="${aliases[ls]:-gls}"
+fi
+
 if is-callable 'dircolors'; then
   # GNU Core Utilities

Can you check if coreutils has been installed ?

@belak
Copy link
Collaborator

belak commented Jan 20, 2020

The problem is that normally coreutils is installed without the g prefix. I may port over the same fix that I implemented for my zsh-utils: https://github.com/belak/zsh-utils/blob/8e2a0280/utility/utility.plugin.zsh#L9-L28

@belak belak linked a pull request Jan 20, 2020 that will close this issue
@GaRUi
Copy link

GaRUi commented Jan 21, 2020

Thank you so much belak :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants