aboutsummaryrefslogtreecommitdiff
path: root/console-tools/resize.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-10-08 22:18:24 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-10-08 22:18:24 +0200
commitd315a77a79817d364a1562f4457c21fbb8174025 (patch)
treed8f6d5b7ac938f03aace7b30418eaccba38a96b2 /console-tools/resize.c
parentecac9853f29dcb2e5e0d70c0effaae2cabeefabf (diff)
downloadbusybox-w32-d315a77a79817d364a1562f4457c21fbb8174025.tar.gz
busybox-w32-d315a77a79817d364a1562f4457c21fbb8174025.tar.bz2
busybox-w32-d315a77a79817d364a1562f4457c21fbb8174025.zip
resize: use tcgetattr(TCSAFLUSH) instead of TCSANOW, closes 13811
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'console-tools/resize.c')
-rw-r--r--console-tools/resize.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/console-tools/resize.c b/console-tools/resize.c
index 59d468d48..056e33750 100644
--- a/console-tools/resize.c
+++ b/console-tools/resize.c
@@ -74,7 +74,19 @@ int resize_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
74 + (1 << SIGTERM) 74 + (1 << SIGTERM)
75 + (1 << SIGALRM) 75 + (1 << SIGALRM)
76 , onintr); 76 , onintr);
77 tcsetattr(STDERR_FILENO, TCSANOW, &new); 77 /* Users report:
78 * The resize command messes up the terminal.
79 * In my case it looks like it is hanging and
80 * I need to press ctrl-c to get a prompt.
81 * Actually the program does not hang but just
82 * the terminal is messed up.
83 * Replaced TCSANOW with TCSAFLUSH:
84 * "the change occurs after all output written to fd
85 * has been transmitted, and all input that has been
86 * received but not read will be discarded before
87 * the change is made.
88 */
89 tcsetattr(STDERR_FILENO, TCSAFLUSH, &new);
78 90
79 /* save_cursor_pos 7 91 /* save_cursor_pos 7
80 * scroll_whole_screen [r 92 * scroll_whole_screen [r