mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
add check for colored ls on openbsd.
This commit is contained in:
parent
e30a1243dc
commit
b564e1e1fe
1 changed files with 6 additions and 0 deletions
|
|
@ -11,6 +11,12 @@ then
|
||||||
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
||||||
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
||||||
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
||||||
|
elif [[ "$(uname -s)" == "OpenBSD" ]]; then
|
||||||
|
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base, with color and
|
||||||
|
# multibyte support) are available from ports. "colorls" will be installed on purpose
|
||||||
|
# and can't be pulled in by installing coreutils, so prefer it to "gls".
|
||||||
|
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
||||||
|
colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
|
||||||
else
|
else
|
||||||
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue