← Commit list

d315a77a7

Denys Vlasenko
Denys Vlasenko
2021-10-08
SUCCESS Duration: 154s

Subject

resize: use tcgetattr(TCSAFLUSH) instead of TCSANOW, closes 13811

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

console-tools/resize.c+13 -1
@@ -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