summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2021-10-08 22:18:24 +0200
committerDenys Vlasenko2021-10-08 22:18:24 +0200
commitd315a77a79817d364a1562f4457c21fbb8174025 (patch)
treed8f6d5b7ac938f03aace7b30418eaccba38a96b2
parentecac9853f29dcb2e5e0d70c0effaae2cabeefabf (diff)
downloadbusybox-d315a77a79817d364a1562f4457c21fbb8174025.zip
busybox-d315a77a79817d364a1562f4457c21fbb8174025.tar.gz
resize: use tcgetattr(TCSAFLUSH) instead of TCSANOW, closes 13811
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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 59d468d..056e337 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)
+ (1 << SIGTERM)
+ (1 << SIGALRM)
, onintr);
- tcsetattr(STDERR_FILENO, TCSANOW, &new);
+ /* Users report:
+ * The resize command messes up the terminal.
+ * In my case it looks like it is hanging and
+ * I need to press ctrl-c to get a prompt.
+ * Actually the program does not hang but just
+ * the terminal is messed up.
+ * Replaced TCSANOW with TCSAFLUSH:
+ * "the change occurs after all output written to fd
+ * has been transmitted, and all input that has been
+ * received but not read will be discarded before
+ * the change is made.
+ */
+ tcsetattr(STDERR_FILENO, TCSAFLUSH, &new);
/* save_cursor_pos 7
* scroll_whole_screen [r