diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2024-02-14 23:10:04 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2024-02-14 23:18:04 +0900 |
commit | 054f4801e67d70436c44563a5144e8b84596e553 (patch) | |
tree | a76f27ac2b9cf0701d2aa3fb8f2dffa6af57726c /winsup | |
parent | 2a2a6486a089b90d05b258bd853d136f00cb7c69 (diff) | |
download | newlib-054f4801e67d70436c44563a5144e8b84596e553.zip newlib-054f4801e67d70436c44563a5144e8b84596e553.tar.gz newlib-054f4801e67d70436c44563a5144e8b84596e553.tar.bz2 |
Cygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector.
Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/fhandler/pty.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc index d31d30b..e52590c 100644 --- a/winsup/cygwin/fhandler/pty.cc +++ b/winsup/cygwin/fhandler/pty.cc @@ -970,7 +970,7 @@ fhandler_pty_slave::open (int flags, mode_t) set_output_handle (to_master_local); if (_major (myself->ctty) == DEV_CONS_MAJOR - && !(!pinfo (myself->ppid) && getenv ("ConEmuPID"))) + && !(!pinfo (myself->ppid) && GetModuleHandle ("ConEmuHk64.dll"))) /* This process is supposed to be a master process which is running on console. Invisible console will be created in primary slave process to prevent overriding code page @@ -1049,6 +1049,8 @@ fhandler_pty_slave::close () fhandler_pty_common::close (); if (!ForceCloseHandle (output_mutex)) termios_printf ("CloseHandle (output_mutex<%p>), %E", output_mutex); + if (!get_ttyp ()->invisible_console_pid && myself->ctty == CTTY_RELEASED) + FreeConsole(); if (get_ttyp ()->invisible_console_pid && !pinfo (get_ttyp ()->invisible_console_pid)) get_ttyp ()->invisible_console_pid = 0; |