* [PATCH] Cygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector.
@ 2024-02-14 14:26 Takashi Yano
0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2024-02-14 14:26 UTC (permalink / raw)
To: cygwin-patches; +Cc: Takashi Yano
Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
---
winsup/cygwin/fhandler/pty.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc
index d31d30b1f..e52590c9d 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;
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-14 14:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14 14:26 [PATCH] Cygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector Takashi Yano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).