# HG changeset patch # User Augie Fackler # Date 1606010522 18000 # Node ID b78aa03c0c006591b2cd9bba41b7ab1968380f5a # Parent 1b863525992d6b070d2cae3e5c05a51114913b99 zshrc: silence noisy which(1) implementations Some of them like to write to stdout, fun. diff --git a/.zshrc b/.zshrc --- a/.zshrc +++ b/.zshrc @@ -9,7 +9,7 @@ done if [ ! "$SHOWED_SCREEN_MESSAGE" = "true" ]; then # Use /bin/which explicitly because we have a shell function # that confuses the zsh built-in which. - if sh -c 'which screen' > /dev/null; then + if sh -c 'which screen' 2> /dev/null > /dev/null; then detached_screens=`screen -list | grep Detached | sed -e 's/ (Detached)//'` if [ ! -z "$detached_screens" ]; then echo "+---------------------------------------+" @@ -22,7 +22,7 @@ if [ ! "$SHOWED_SCREEN_MESSAGE" = "true" fi if [ ! "$SHOWED_TMUX_MESSAGE" = "true" ]; then - if which tmux > /dev/null; then + if which tmux 2> /dev/null > /dev/null; then detached_screens=$(tmux ls 2> /dev/null | grep -v attached) if [ ! -z "$detached_screens" ]; then echo "+-----------------------------------------------------------+"