bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tput's behaviour changed


From: Thomas Dickey
Subject: Re: tput's behaviour changed
Date: Sun, 21 Nov 2021 16:54:08 -0500 (EST)

----- Original Message -----
| From: "Ehsan Ghorbannezhad" <ehsan@disroot.org>
| To: "Ncurses Mailing List" <bug-ncurses@gnu.org>
| Sent: Sunday, November 21, 2021 4:02:48 PM
| Subject: tput's behaviour changed

| Hi,
| 
| The ncurses-6.2-20211009 patch contains changes to the progs/tty_settings.c
| file, which cause the `tput cols` and `tput lines` commands to return
| wrong values (80 and 24) when invoked from inside
| my terminal file manager's previewer script.
| 
| Per my testing, these are the changes that cause this breakage:
| 
| --- ncurses-6.2-20211002+/progs/tty_settings.c
| +++ ncurses-6.2-20211009/progs/tty_settings.c
| @@ -74,10 +74,12 @@
| {
|     if (!get_tty_settings(STDERR_FILENO, tty_settings) &&
|       !get_tty_settings(STDOUT_FILENO, tty_settings) &&
| -     !get_tty_settings(STDIN_FILENO, tty_settings) &&
| -     !get_tty_settings(open("/dev/tty", O_RDWR), tty_settings)) {
| +     !get_tty_settings(STDIN_FILENO, tty_settings)) {
|       if (need_tty) {
| -         failed("terminal attributes");
| +         int fd = open("/dev/tty", O_RDWR);
| +         if (!get_tty_settings(fd, tty_settings)) {
| +             failed("terminal attributes");
| +         }
|       } else {
|           my_fd = fileno(stdout);
|       }
| 
| All versions prior to 6.2-20211009 don't have this problem.
| Tested on several terminal emulators.

start here

https://lists.gnu.org/archive/html/bug-ncurses/2021-11/msg00001.html

-- 
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://ftp.invisible-island.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]