- This patch fixes the failure of input switching between io_handle
and io_handle_nat. This very rarely happens, however, input is
wrongly switched to io_handle_nat even though the non-cygwin app
is in the background.
isHybrid = true;
setup_locale ();
myself->exec_dwProcessId = myself->dwProcessId;
+ myself->process_state |= PID_NEW_PG; /* Marker for pcon_fg */
bool nopcon = (disable_pcon || !term_has_pcon_cap (NULL));
WaitForSingleObject (pcon_mutex, INFINITE);
bool pcon_enabled = setup_pseudoconsole (nopcon);
}
}
myself->exec_dwProcessId = 0;
+ myself->process_state &= ~PID_NEW_PG;
isHybrid = false;
}
}
_pinfo *p = pids[i];
if (p->ctty == get_ttyp ()->ntty
&& p->pgid == get_ttyp ()->getpgid ()
+ && (p->process_state & PID_NOTCYGWIN)
&& (p->process_state & PID_NEW_PG))
{
wpid = p->dwProcessId;
for (unsigned i = 0; i < pids.npids; i++)
{
_pinfo *p = pids[i];
- if (p->ctty == ntty && p->pgid == pgid && p->exec_dwProcessId)
+ if (p->ctty == ntty && p->pgid == pgid
+ && (p->process_state & (PID_NOTCYGWIN | PID_NEW_PG)))
return true;
}
if (pgid > MAX_PID)