summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-24 17:48:18 +0000
committerbrian m. carlson <sandals@crustytoothpaste.net>2019-02-24 18:26:47 +0000
commit3663c32171ba61727ed705774ece3ea78cf3a9ce (patch)
tree2f53ad23f34b3eea7986475f5086e7bd86d3c29c
parent03857d98c4170ce2da05b1abc1b706d34f16203c (diff)
zsh/zshrc: don't set GREP_COLORS on WSLwsl-test
On Windows Subsystem for Linux 1809, zsh hangs if given a pipe inside a command substitution. This is true even if the pipe is in a shell function and the shell function is called from the command substitution. If /proc/version exists and it looks like it's from a WSL instance, don't set GREP_COLORS, since the shell function used invokes a pipe to perl. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
-rw-r--r--zsh/zshrc6
1 files changed, 5 insertions, 1 deletions
diff --git a/zsh/zshrc b/zsh/zshrc
index 9722180..3566f68 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -310,8 +310,12 @@ setup_colors () {
export LESS_TERMCAP_so=$(print -P $(bmc_palette standout))
export LESS_TERMCAP_ue=$(print -P $(color_reset))
export LESS_TERMCAP_us=$(print -P $(bmc_palette underline))
- export GREP_COLORS=fn=$(bmc_palette_ansi grep)
export CLICOLOR=1
+
+ if !grep -qs Microsoft /proc/version 2>/dev/null
+ then
+ export GREP_COLORS=fn=$(bmc_palette_ansi grep)
+ fi
}
setup_autoload () {
local func i