Fix eend so that it works properly on a standard BSD console. Thanks to UberLord...
authorZac Medico <zmedico@gentoo.org>
Wed, 2 May 2007 17:23:44 +0000 (17:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 2 May 2007 17:23:44 +0000 (17:23 -0000)
svn path=/main/branches/2.1.2/; revision=6468

bin/isolated-functions.sh [changed mode: 0755->0644]
pym/output.py

old mode 100755 (executable)
new mode 100644 (file)
index 5aa838b..01fbbf2
@@ -206,6 +206,8 @@ set_colors() {
        (( COLS == 0 )) && COLS=$(set -- $(stty size 2>/dev/null) ; echo $2)
        (( COLS > 0 )) || (( COLS = 80 ))
        COLS=$((${COLS} - 8))   # width of [ ok ] == 7
+       # Adjust COLS so that eend works properly on a standard BSD console.
+       [ "${TERM}" = "cons25" ] && COLS=$((${COLS} - 1))
 
        ENDCOL=$'\e[A\e['${COLS}'C'    # Now, ${ENDCOL} will move us to the end of the
                                       # column;  irregardless of character width
index 660f06999366cb1e73630320881bfbb28f1ccec5..8c8813e423b4da728800c964006c3c90eba96c0e 100644 (file)
@@ -277,6 +277,9 @@ class EOutput:
                                pass
                if columns <= 0:
                        columns = 80
+               # Adjust columns so that eend works properly on a standard BSD console.
+               if os.environ.get("TERM") == "cons25":
+                       columns = columns - 1
                self.term_columns = columns
 
        def __eend(self, caller, errno, msg):