Cygwin: pty: Disable FreeConsole() on close for non cygwin process.
- After commite1a0775dc0
, the problem reported in https://www.cygwin.com/ml/cygwin/2020-01/msg00093.html occurs. For Gnu scren and tmux, calling FreeConsole() on pty close is necessary. However, if FreeConsole() is called, cygwin setup with '-h' option does not work. Therefore, the commite1a0775dc0
delayed closing pty. This is the cause of the problem above. Now, instead of delaying pty close, FreeConsole() is not called if the process is non cygwin processes such as cygwin setup.
This commit is contained in:
committed by
Corinna Vinschen
parent
783eaa888f
commit
2f415d5efa
@@ -66,6 +66,7 @@ struct pipe_reply {
|
||||
static int pcon_attached_to = -1;
|
||||
static bool isHybrid;
|
||||
static bool do_not_reset_switch_to_pcon;
|
||||
static bool freeconsole_on_close = true;
|
||||
|
||||
#if USE_API_HOOK
|
||||
static void
|
||||
@@ -725,7 +726,8 @@ fhandler_pty_slave::~fhandler_pty_slave ()
|
||||
if (used == 0)
|
||||
{
|
||||
init_console_handler (false);
|
||||
FreeConsole ();
|
||||
if (freeconsole_on_close)
|
||||
FreeConsole ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2660,6 +2662,12 @@ fhandler_pty_slave::setup_locale (void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fhandler_pty_slave::set_freeconsole_on_close (bool val)
|
||||
{
|
||||
freeconsole_on_close = val;
|
||||
}
|
||||
|
||||
void
|
||||
fhandler_pty_slave::fixup_after_attach (bool native_maybe, int fd_set)
|
||||
{
|
||||
@@ -2783,7 +2791,8 @@ fhandler_pty_slave::fixup_after_exec ()
|
||||
if (used == 1 /* About to close this tty */)
|
||||
{
|
||||
init_console_handler (false);
|
||||
FreeConsole ();
|
||||
if (freeconsole_on_close)
|
||||
FreeConsole ();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user