From 21d8b0294b4804f4f7a3a4d9fd0aab216139c6bb Mon Sep 17 00:00:00 2001 From: Georgy Yakovlev Date: Sun, 24 Apr 2016 22:49:05 -0700 Subject: [PATCH] Fix for OpenBSD ls alias https://github.com/Eriner/zim/issues/47 Closes #48 --- modules/utility/init.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 58aade9..a89047a 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -31,7 +31,14 @@ else export LSCOLORS='exfxcxdxbxGxDxabagacad' export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:' - alias ls='ls -G' + # stock OpenBSD ls does not support colors at all, but colorls does. + if [[ $OSTYPE == openbsd* ]]; then + if (( ${+commands[colorls]} )); then + alias ls='colorls -G' + fi + else + alias ls='ls -G' + fi fi