Skip to content

Commit 249b8e8

Browse files
committed
Cygwin: console: Fix the console mode for background non-cygwin app
In the commit 0bfd91d, the behaviour of the tty::restore was changed so that the console mode is set to the previouslly stored console mode. Therefore, the console mode for the background non- cygwin app should not be set to tty::restore anymore in setup_for_ non_cygwin_app(). This should have been fixed in that commit. This patch belatedly fixes it. Fixes: 0bfd91d ("Cygwin: console: tty::restore really restores the previous mode") Signed-off-by: Takashi Yano <[email protected]> (cherry picked from commit 854150f)
1 parent c94808b commit 249b8e8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

winsup/cygwin/fhandler/console.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -905,13 +905,14 @@ fhandler_console::setup_for_non_cygwin_app ()
905905
/* Setting-up console mode for non-cygwin app. */
906906
/* If conmode is set to tty::native for non-cygwin apps
907907
in background, tty settings of the shell is reflected
908-
to the console mode of the app. So, use tty::restore
909-
for background process instead. */
910-
tty::cons_mode conmode =
911-
(get_ttyp ()->getpgid ()== myself->pgid) ? tty::native : tty::restore;
912-
set_input_mode (conmode, &tc ()->ti, get_handle_set ());
913-
set_output_mode (conmode, &tc ()->ti, get_handle_set ());
914-
set_disable_master_thread (true, this);
908+
to the console mode of the app. So, do not change the
909+
console mode. */
910+
if (get_ttyp ()->getpgid () == myself->pgid)
911+
{
912+
set_input_mode (tty::native, &tc ()->ti, get_handle_set ());
913+
set_output_mode (tty::native, &tc ()->ti, get_handle_set ());
914+
set_disable_master_thread (true, this);
915+
}
915916
}
916917

917918
void

0 commit comments

Comments
 (0)