From ccd417584aefdb5447cf8cc0fa509c14d5a81289 Mon Sep 17 00:00:00 2001 From: Daniel Miranda Date: Mon, 22 Apr 2013 18:17:01 +0200 Subject: [PATCH] Cygwin lack of 'o' option for ps shows error messages on every prompt Cygwin doesn't support the 'o' option for ps (version: ps (cygwin) 1.7.17), which causes errors to show on every prompt displayed. A simple fix is redirecting stderr to /dev/nullin liquidprompt/liquidprompt (it might actually be a good idea to do the same for other commands, since any kind of undesired output makes the prompt pretty much blow up). --- liquidprompt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 3990ad3..5c68960 100755 --- a/liquidprompt +++ b/liquidprompt @@ -361,7 +361,7 @@ _lp_connection() else # TODO check on *BSD local sess_src=$(who am i | sed -n 's/.*(\(.*\))/\1/p') - local sess_parent=$(ps -o comm= -p $PPID) + local sess_parent=$(ps -o comm= -p $PPID 2> /dev/null) if [[ -z "$sess_src" || "$sess_src" = ":"* ]] ; then echo lcl # Local elif [[ "$sess_parent" = "su" || "$sess_parent" = "sudo" ]] ; then