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).
This commit is contained in:
Daniel Miranda 2013-04-22 18:17:01 +02:00 committed by nojhan
parent f4815f07f0
commit ccd417584a

View File

@ -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