Closed aimuch closed 2 years ago
You can replace the default BSD-flavored version of ls
with the GNU version to get back that option. brew install coreutils
will get you these tools. Some more info here: https://stackoverflow.com/a/57973942
You can replace the default BSD-flavored version of
ls
with the GNU version to get back that option.brew install coreutils
will get you these tools. Some more info here: https://stackoverflow.com/a/57973942
Think you, it works.👍
A symlink worked for me, without having to add everything from coreutils into my $PATH
:
brew install coreutils
ln -s /usr/local/opt/coreutils/libexec/gnubin/ls /usr/local/bin
Then ensure /usr/local/bin
is in your $PATH
before /bin
.
I first tried an alias ls=/usr/local/opt/coreutils/libexec/gnubin/ls
but this didn't work since SCM Breeze refers to \ls
which disregards any aliases.
Sadly this didn't work for me. Any progress on getting this fixed in the core release?
I don't have the hardware to test, so I haven't done any work concerning this.
Bumping into this one on Monterey too
brew install coreutils
and this patch fixed it for me:
diff --git a/lib/git/shell_shortcuts.sh b/lib/git/shell_shortcuts.sh
index 43b7215..052b663 100644
--- a/lib/git/shell_shortcuts.sh
+++ b/lib/git/shell_shortcuts.sh
@@ -116,10 +116,10 @@ if [ "$shell_ls_aliases_enabled" = "true" ] && builtin command -v ruby > /dev/nu
local ll_output
local ll_command # Ensure sort ordering of the two invocations is the same
if [ "$_ls_bsd" != "BSD" ]; then
- ll_command=(\ls -hv --group-directories-first)
+ ll_command=(\gls -hv --group-directories-first)
ll_output="$("${ll_command[@]}" -l --color "$@")"
else
- ll_command=(\ls)
+ ll_command=(\gls)
ll_output="$(CLICOLOR_FORCE=1 "${ll_command[@]}" -lG "$@")"
fi
There's already code that's meant to identify macOS, but it's broken on recent macOS versions:
This code runs ls --color=auto
and checks whether that results in an error. If it does, the code assumes that the OS is macOS (technically BSD). According to https://github.com/fish-shell/fish-shell/issues/8309, Big Sur added a --color
option to ls
. So the exit status of ls --color=auto
no longer differentiates the BSD version of ls
from the GNU version.
An easy fix would be to use something like ls --author
instead of ls --color=auto
.