From c4aa72fc1f024aeb1925273c2eae4cc4f5aeaeee Mon Sep 17 00:00:00 2001 From: Pierre Carru Date: Tue, 26 Aug 2014 10:37:32 +0100 Subject: [PATCH 1/2] Make shell client work in OS X: - use gnu env for `env -0`, - use filesystem socket. --- client/powerline.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/powerline.sh b/client/powerline.sh index 2c85fe77..b112ec21 100755 --- a/client/powerline.sh +++ b/client/powerline.sh @@ -1,11 +1,21 @@ #!/bin/sh +test "${OSTYPE#darwin}" = "${OSTYPE}" && darwin=n || darwin=y + if test "$1" = "--socket" ; then shift ADDRESS="$1" shift else ADDRESS="powerline-ipc-${UID:-`id -u`}" + test "$darwin" = y && ADDRESS="/tmp/$ADDRESS" +fi + +if test "$darwin" = y; then + ENV=genv +else + ENV=env + ADDRESS="abstract-client:$ADDRESS" fi # Warning: env -0 does not work in busybox. Consider switching to parsing @@ -16,8 +26,8 @@ fi printf '%s\0' "$argv" done printf '%s\0' "$PWD" - env -0 -) | socat -lf/dev/null -t 10 - abstract-client:"$ADDRESS" + $ENV -0 +) | socat -lf/dev/null -t 10 - "$ADDRESS" if test $? -ne 0 ; then powerline-render "$@" From 37546f4ad2bf6c773e1f159cb043921f14bb41a8 Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 26 Aug 2014 19:31:10 +0400 Subject: [PATCH 2/2] Update shell powerline client OSX requirements in documentation --- docs/source/installation/osx.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/source/installation/osx.rst b/docs/source/installation/osx.rst index 204666a7..70523b78 100644 --- a/docs/source/installation/osx.rst +++ b/docs/source/installation/osx.rst @@ -17,6 +17,11 @@ Python package . +.. note:: + In case you want or have to use ``powerline.sh`` socat-based client you + should also install GNU env named ``genv``. This may be achieved by running + ``brew install coreutils``. + 2. Install Powerline using the following command:: pip install --user git+git://github.com/Lokaltog/powerline