Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cygwin: console: Redesign mode set strategy on close().
The required console mode for a non-cygwin process is different from that for a cygwin process. There are currently three modes: tty::cygwin, tty::native, and tty::restore. The latter two are for the non-cygwin processes. tty::restore is the mode for the non-cygwin processes that started the cygwin process, used to restore the previous behaviour. tty::native is the mode that reflects some terminfo flags. The issue below is caused because the console mode fails to be restored to the previous console mode used by cmd.exe. This patch redesigns the strategy to determine which mode should be set on console close() to fix all similar problems. Previously, the number of handle count is used to determine the appropriate console mode. However, the handle count seems uncertain for that purpose. In the new design, the relation ship between the master process and the process that is about to close the console is mainly used. This can provide more certain result than previous one. Addresses: microsoft/git#730 Backported-from: 3312f2d (Cygwin: console: Redesign mode set strategy on close()., 2025-03-03) Fixes: 30d2669 ("Cygwin: console: Fix clean up conditions in close()") Reported-by: Mike Marcelais, Johannes Schindelin <[email protected]> Signed-off-by: Takashi Yano <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information