commit:     bf2c509abfe1bcd2835531861425d2f33c06e13e
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Feb 24 19:27:32 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun  7 11:12:18 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=bf2c509a

Drop support for the checkwinsize feature of bash

While there is nothing wrong with the way in which it is presently
being used, the feature is sufficiently bug-ridden that it will not work
correctly with the impending overhaul of the _eprint() and _eend()
functions. As such, drop support for it in advance. Chet has pledged to
treat my bug report as a feature request, so it may yet be possible to
re-introduce support for it in the future.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Bug: https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00142.html
Signed-off-by: Sam James <sam <AT> gentoo.org>

 functions.sh | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/functions.sh b/functions.sh
index 78317b3..44a6dce 100644
--- a/functions.sh
+++ b/functions.sh
@@ -512,19 +512,9 @@ else
 fi
 
 # Try to determine the number of available columns in the terminal.
-for _ in 1 2 3; do
+for _ in 1 2; do
        case $_ in
                1)
-                       # Running an external command causes bash >=4.3 to set
-                       # the COLUMNS variable, provided that the checkwinsize
-                       # shopt is enabled. As of 5.0, it's enabled by default.
-                       # shellcheck disable=3044
-                       if [ -n "${BASH}" ] && shopt -s checkwinsize 
2>/dev/null; then
-                               /bin/true
-                       fi
-                       genfun_cols=${COLUMNS}
-                       ;;
-               2)
                        # This use of stty(1) is portable as of POSIX Issue 8.
                        genfun_cols=$(
                                stty size 2>/dev/null | {
@@ -534,7 +524,7 @@ for _ in 1 2 3; do
                                }
                        )
                        ;;
-               3)
+               2)
                        # Give up and assume 80 available columns.
                        genfun_cols=80
                        break

Reply via email to