set_colors(): Redirect input to `stty size` to make it work after
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Sun, 18 Dec 2011 20:43:51 +0000 (21:43 +0100)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Sun, 18 Dec 2011 20:43:51 +0000 (21:43 +0100)
commit a3797a63a30579be3ba5418aad7e76fd520f9aee.

bin/isolated-functions.sh

index d2ea319bd8bccd01df7aff2ac0c12708a6ae0deb..1bcc5c90758863765421c26a37c15ea4a9f15707 100644 (file)
@@ -415,7 +415,7 @@ set_colors() {
        # If stdout is a pipe, the parent process can export COLUMNS
        # if it's relevant.
        [[ $COLS == 0 && $EBUILD_PHASE != depend ]] && \
-               COLS=$(set -- $(stty size 2>/dev/null) ; echo $2)
+               COLS=$(set -- $(stty size </dev/tty 2>/dev/null) ; echo $2)
        (( COLS > 0 )) || (( COLS = 80 ))
 
        # Now, ${ENDCOL} will move us to the end of the