From c9de5c5bd2651b4b07782ac83e9f8bd3ff85c8e9 Mon Sep 17 00:00:00 2001 From: Alex Poslavsky Date: Tue, 17 May 2016 15:28:18 +0300 Subject: [PATCH] [utility] fix OpenBSD grep color Use ggrep or use no color, also fixes #54. Closes #54, closes #55 --- modules/utility/init.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index a89047a..9fb20aa 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -48,7 +48,13 @@ fi export GREP_COLOR='37;45' #BSD export GREP_COLORS="mt=${GREP_COLOR}" #GNU -alias grep='grep --color=auto' +if [[ ${OSTYPE} == openbsd* ]]; then + if (( ${+commands[ggrep]} )); then + alias grep='ggrep --color=auto' + fi +else + alias grep='grep --color=auto' +fi #