commit:     e6d36c7fe9fbddfbba98ce73bc61927a9cf27dba
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Jan 28 02:12:07 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb  6 01:45:13 2026 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=e6d36c7f

tty: refresh the column count at secondly intervals

Limit the rate at which the number of terminal columns may be gauged to
intervals of one second, as opposed to half-seconds. Responsiveness is
duly maintained while further limiting the impact of syscall overhead.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 functions/tty.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/functions/tty.sh b/functions/tty.sh
index 91e4d61..293f21c 100644
--- a/functions/tty.sh
+++ b/functions/tty.sh
@@ -64,7 +64,7 @@ _update_columns()
                local IFS
 
                # Two optimisations are applied. Firstly, the rate at which
-               # updates can be performed is throttled to intervals of half a
+               # updates can be performed is throttled to intervals of one
                # second. Secondly, if running on bash then the COLUMNS variable
                # may be gauged, albeit only in situations where doing so can be
                # expected to work reliably.
@@ -73,7 +73,7 @@ _update_columns()
                        # Python's pty module is broken. For now, expect for
                        # portage to have exported COLUMNS to the environment.
                        set -- 0 "${COLUMNS}"
-               elif _should_throttle 50; then
+               elif _should_throttle 100; then
                        test "${genfun_cols}"
                        return
                elif [ "${genfun_bin_true}" ] && [ "$$" = "${BASHPID}" ]; then

Reply via email to