diff --git a/msys2-runtime/0056-Cygwin-console-Call-set_input_mode-after-changing-di.patch b/msys2-runtime/0056-Cygwin-console-Call-set_input_mode-after-changing-di.patch new file mode 100644 index 00000000000..c84309ed8af --- /dev/null +++ b/msys2-runtime/0056-Cygwin-console-Call-set_input_mode-after-changing-di.patch @@ -0,0 +1,74 @@ +From 6673d8e1b8a1be0e06528735d5375e1891bbe997 Mon Sep 17 00:00:00 2001 +From: Takashi Yano +Date: Thu, 3 Jul 2025 10:51:09 +0900 +Subject: [PATCH 56/N] Cygwin: console: Call set_input_mode() after changing + disable_master_thread + +With the commit 476135a24506, set_input_mode() reffers to the flag +disable_master_thread in tty::cygwin mode. So it is necessary to call +set_input_mode() after changing disable_master_thread flag. However, +the commit 476135a24506 was missing that. + +With this patch, set_input_mode() is called after changing the flag +disable_master_thread, if the console input mode is tty::cygwin. + +Fixes: 476135a24506 ("Cygwin: console: Set ENABLE_PROCESSED_INPUT when disable_master_thread"); +Signed-off-by: Takashi Yano +Cherry-picked-from: 65a48c7202 (Cygwin: console: Call set_input_mode() after changing disable_master_thread, 2025-07-03) +Signed-off-by: Johannes Schindelin +--- + winsup/cygwin/fhandler/console.cc | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc +index 48c9326..831df4f 100644 +--- a/winsup/cygwin/fhandler/console.cc ++++ b/winsup/cygwin/fhandler/console.cc +@@ -923,12 +923,12 @@ fhandler_console::cleanup_for_non_cygwin_app (handle_set_t *p) + termios *ti = shared_console_info[unit] ? + &(shared_console_info[unit]->tty_min_state.ti) : &dummy; + /* Cleaning-up console mode for non-cygwin app. */ ++ set_disable_master_thread (con.owner == GetCurrentProcessId ()); + /* conmode can be tty::restore when non-cygwin app is + exec'ed from login shell. */ + tty::cons_mode conmode = cons_mode_on_close (p); + set_output_mode (conmode, ti, p); + set_input_mode (conmode, ti, p); +- set_disable_master_thread (con.owner == GetCurrentProcessId ()); + } + + /* Return the tty structure associated with a given tty number. If the +@@ -1121,8 +1121,8 @@ fhandler_console::bg_check (int sig, bool dontsignal) + in the same process group. */ + if (sig == SIGTTIN && con.curr_input_mode != tty::cygwin) + { +- set_input_mode (tty::cygwin, &tc ()->ti, get_handle_set ()); + set_disable_master_thread (false, this); ++ set_input_mode (tty::cygwin, &tc ()->ti, get_handle_set ()); + } + if (sig == SIGTTOU && con.curr_output_mode != tty::cygwin) + set_output_mode (tty::cygwin, &tc ()->ti, get_handle_set ()); +@@ -1987,8 +1987,8 @@ fhandler_console::post_open_setup (int fd) + /* Setting-up console mode for cygwin app started from non-cygwin app. */ + if (fd == 0) + { +- set_input_mode (tty::cygwin, &get_ttyp ()->ti, &handle_set); + set_disable_master_thread (false, this); ++ set_input_mode (tty::cygwin, &get_ttyp ()->ti, &handle_set); + } + else if (fd == 1 || fd == 2) + set_output_mode (tty::cygwin, &get_ttyp ()->ti, &handle_set); +@@ -2995,7 +2995,12 @@ fhandler_console::char_command (char c) + if (con.args[i] == 1) /* DECCKM */ + con.cursor_key_app_mode = (c == 'h'); + if (con.args[i] == 9001) /* win32-input-mode (https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md) */ +- set_disable_master_thread (c == 'h', this); ++ { ++ set_disable_master_thread (c == 'h', this); ++ if (con.curr_input_mode == tty::cygwin) ++ set_input_mode (tty::cygwin, ++ &tc ()->ti, get_handle_set ()); ++ } + } + /* Call fix_tab_position() if screen has been alternated. */ + if (need_fix_tab_position) diff --git a/msys2-runtime/PKGBUILD b/msys2-runtime/PKGBUILD index 7549777aece..928fc2565b7 100644 --- a/msys2-runtime/PKGBUILD +++ b/msys2-runtime/PKGBUILD @@ -4,7 +4,7 @@ pkgbase=msys2-runtime pkgname=('msys2-runtime' 'msys2-runtime-devel') pkgver=3.6.3 -pkgrel=6 +pkgrel=7 pkgdesc="Cygwin POSIX emulation engine" arch=('x86_64') url="https://www.cygwin.com/" @@ -81,9 +81,10 @@ source=('msys2-runtime'::git+https://github.com/cygwin/cygwin#tag=cygwin-${pkgve 0052-Cygwin-pipe-Fix-SSH-hang-with-non-cygwin-pipe-reader.patch 0053-Cygwin-pipe-Update-source-comment-align-with-previou.patch 0054-Cygwin-pipe-Make-pipe_data_available-return-PDA_UNKN.patch - 0055-Cygwin-console-Set-ENABLE_PROCESSED_INPUT-when-disab.patch) + 0055-Cygwin-console-Set-ENABLE_PROCESSED_INPUT-when-disab.patch + 0056-Cygwin-console-Call-set_input_mode-after-changing-di.patch) sha256sums=('53d2be8a2dcf58e7eae7823ef01a5b8ce0eba704b132d19167396eb162db378c' - 'dd0932cf89a81792e9c68a9f4c4689182136fa51b576ca04c443b00b1f88f8a5' + 'cf35ed71d4d740240a20e3fd075885302d859ac0a7178fc6a89619124539a81a' '5538db757661949423563bab5e4f383dfa4ef0cf3301cf43f23b482392554b3b' '2fb9b2b297797d20cd901eaee2de735e8cdda1c1e5836e9ff77856c0d1216860' '780977d71e35bbe4c0dcda5272895267d68d635f311e224f7981858f7192a85e' @@ -138,7 +139,8 @@ sha256sums=('53d2be8a2dcf58e7eae7823ef01a5b8ce0eba704b132d19167396eb162db378c' 'da17d0c9b64bc866b3b9bcbbeff0f3c109e494fd96d846f7920f08a48a1c9ce5' 'b1acf1b24fa229da75cc522807fb76e94a5389449a652f250cf96151a6d20116' 'de705488bd7572e09f0847ebd96bb8e5ff58f5dcaf7d4a967891939eb48ccf6b' - '7de98fef5c5a79563278fdaefe95d9715477422521da15d0a51cf8e507b797e3') + '7de98fef5c5a79563278fdaefe95d9715477422521da15d0a51cf8e507b797e3' + 'de6475de6d0e84edb9c26e7df33f98872d38d9d7534c128cbc32ae273d41de79') # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -247,7 +249,8 @@ prepare() { 0052-Cygwin-pipe-Fix-SSH-hang-with-non-cygwin-pipe-reader.patch \ 0053-Cygwin-pipe-Update-source-comment-align-with-previou.patch \ 0054-Cygwin-pipe-Make-pipe_data_available-return-PDA_UNKN.patch \ - 0055-Cygwin-console-Set-ENABLE_PROCESSED_INPUT-when-disab.patch + 0055-Cygwin-console-Set-ENABLE_PROCESSED_INPUT-when-disab.patch \ + 0056-Cygwin-console-Call-set_input_mode-after-changing-di.patch } build() { diff --git a/msys2-runtime/msys2-runtime.commit b/msys2-runtime/msys2-runtime.commit index 2f3f6cda179..3fab320e1db 100644 --- a/msys2-runtime/msys2-runtime.commit +++ b/msys2-runtime/msys2-runtime.commit @@ -1 +1 @@ -7674c51e18b9323c0072c8299c9356a7d9511a4e +772caa703db5d9303ab6b24009e80a377ee00b94