Skip to content

Commit 7674c51

Browse files
tyan0dscho
authored andcommitted
Cygwin: console: Set ENABLE_PROCESSED_INPUT when disable_master_thread
Currently, ENABLE_PROCESSED_INPUT is set in set_input_mode() if master_thread_suspended is true. This enables Ctrl-C handling when cons_master_thread is suspended, since Ctrl-C is normally handled by cons_master_thread. However, when disable_master_thread is true, ENABLE_PROCESSED_INPUT is not set, even though this also disables Ctrl-C handling in cons_master_thread. Due to this bug, the command C:\cygwin64\bin\sleep 10 < NUL in the Command Prompt cannot be terminated with Ctrl-C. This patch addresses the issue by setting ENABLE_PROCESSED_INPUT when either disable_master_thread or master_thread_suspended is true. This bug also affects cases where non-Cygwin Git (Git for Windows) launches Cygwin SSH. In such cases, SSH also cannot be terminated with Ctrl-C. Addresses: git-for-windows/git#5682 (comment) Fixes: 746c811 ("Cygwin: console: Allow pasting very long text input.") Reported-by: Johannes Schindelin <[email protected]> Signed-off-by: Takashi Yano <[email protected]> (cherry picked from commit 476135a24506dd624eb46b50fd634fcd740008ba) Cherry-picked-from: 61cc419 (Cygwin: console: Set ENABLE_PROCESSED_INPUT when disable_master_thread, 2025-07-01)) Signed-off-by: Johannes Schindelin <[email protected]>
1 parent fe587e1 commit 7674c51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

winsup/cygwin/fhandler/console.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ fhandler_console::set_input_mode (tty::cons_mode m, const termios *t,
831831
break;
832832
case tty::cygwin:
833833
flags |= ENABLE_WINDOW_INPUT;
834-
if (con.master_thread_suspended)
834+
if (con.master_thread_suspended || con.disable_master_thread)
835835
flags |= ENABLE_PROCESSED_INPUT;
836836
if (wincap.has_con_24bit_colors () && !con_is_legacy)
837837
flags |= ENABLE_VIRTUAL_TERMINAL_INPUT;

0 commit comments

Comments
 (0)