Cygwin: pty: Fix potential state mismatch regarding pseudo console.
- PTY with pseudo console support sitll has problem which potentially cause state mismatch between state variable and real console state. This patch fixes this issue.
This commit is contained in:
parent
915fcd0ae8
commit
b7e4294200
@ -159,14 +159,19 @@ dtable::stdio_init ()
|
|||||||
{
|
{
|
||||||
bool attached = !!fhandler_console::get_console_process_id
|
bool attached = !!fhandler_console::get_console_process_id
|
||||||
(ptys->getHelperProcessId (), true);
|
(ptys->getHelperProcessId (), true);
|
||||||
if (!attached)
|
if (attached)
|
||||||
|
break;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
/* Not attached to pseudo console in fork() or spawn()
|
/* Not attached to pseudo console in fork() or spawn()
|
||||||
by some reason. This happens if the executable is
|
by some reason. This happens if the executable is
|
||||||
a windows GUI binary, such as mintty. */
|
a windows GUI binary, such as mintty. */
|
||||||
FreeConsole ();
|
FreeConsole ();
|
||||||
if (AttachConsole (ptys->getHelperProcessId ()))
|
if (AttachConsole (ptys->getHelperProcessId ()))
|
||||||
break;
|
{
|
||||||
|
ptys->fixup_after_attach (false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user