Skip to content

Commit d9ebf01

Browse files
committed
Cygwin: console: Fix tcsetattr which was broken sinse cygwin 3.5.5
After the commit 84d77e5 ("Cygwin: console: Disable cons_master_thread in win32-input-mode") tcsetattr() no longer takes effect for the console. This occurs because set_input_mode() and set_output_mode() are now called in bg_check() only when the current mode is not tty::cygwin. Before this commit, these functions were always invoked in bg_check(), regardless of whether the current mode was already tty::cygwin. As a result, the console mode was updated every time read() or write() was called. With this patch, set_input_mode() and set_output_mode() are called in tcsetattr() to make it take effect. Fixes: 84d77e5 ("Cygwin: console: Disable cons_master_thread in win32-input-mode") Signed-off-by: Takashi Yano <[email protected]> (cherry picked from commit 4b5dcf2)
1 parent 3336fb8 commit d9ebf01

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

winsup/cygwin/fhandler/console.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,8 @@ int
22152215
fhandler_console::tcsetattr (int a, struct termios const *t)
22162216
{
22172217
get_ttyp ()->ti = *t;
2218+
set_input_mode (tty::cygwin, t, &handle_set);
2219+
set_output_mode (tty::cygwin, t, &handle_set);
22182220
return 0;
22192221
}
22202222

winsup/cygwin/release/3.6.1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ Fixes:
3939

4040
- Don't increment DLL reference count in dladdr.
4141
Addresses: https://cygwin.com/pipermail/cygwin/2025-April/257862.html
42+
43+
- Fix tcsetattr() for console which has been broken sinse cygwin 3.5.5.

0 commit comments

Comments
 (0)