Cygwin: pty: Make GNU screen and tmux work in ConEmu cygwin-connector.
authorTakashi Yano <takashi.yano@nifty.ne.jp>
Wed, 14 Feb 2024 14:10:04 +0000 (23:10 +0900)
committerTakashi Yano <takashi.yano@nifty.ne.jp>
Wed, 14 Feb 2024 14:18:04 +0000 (23:18 +0900)
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

index d31d30b1fc21b5a74803fd888715fd418a2e93de..e52590c9d23a30dcc29f73338ee0e7b065facce9 100644 (file)
@@ -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;
This page took 0.034733 seconds and 5 git commands to generate.