summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/fhandler_console.cc23
-rw-r--r--winsup/cygwin/release/3.1.54
2 files changed, 15 insertions, 12 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 42040a971..328424a7d 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1159,18 +1159,17 @@ fhandler_console::close ()
acquire_output_mutex (INFINITE);
- if (shared_console_info && myself->pid == con.owner &&
- wincap.has_con_24bit_colors () && !con_is_legacy)
- request_xterm_mode_output (false);
-
- /* Restore console mode if this is the last closure. */
- OBJECT_BASIC_INFORMATION obi;
- NTSTATUS status;
- status = NtQueryObject (get_handle (), ObjectBasicInformation,
- &obi, sizeof obi, NULL);
- if (NT_SUCCESS (status) && obi.HandleCount == 1)
- if (wincap.has_con_24bit_colors ())
- request_xterm_mode_output (false);
+ if (shared_console_info && wincap.has_con_24bit_colors ())
+ {
+ /* Restore console mode if this is the last closure. */
+ OBJECT_BASIC_INFORMATION obi;
+ NTSTATUS status;
+ status = NtQueryObject (get_handle (), ObjectBasicInformation,
+ &obi, sizeof obi, NULL);
+ if ((NT_SUCCESS (status) && obi.HandleCount == 1)
+ || myself->pid == con.owner)
+ request_xterm_mode_output (false);
+ }
release_output_mutex ();
diff --git a/winsup/cygwin/release/3.1.5 b/winsup/cygwin/release/3.1.5
index 796fd2126..e34fdb88d 100644
--- a/winsup/cygwin/release/3.1.5
+++ b/winsup/cygwin/release/3.1.5
@@ -5,3 +5,7 @@ Bug Fixes:
Don't move cursor to the right in case of a NUL character in the console
output stream, this is not backed by terminfo.
Addresses: https://cygwin.com/ml/cygwin/2020-02/msg00162.html
+
+- Fix a segfault when starting, e.g., mintty from a bash in a console
+ running xterm emulation.
+ Addresses: https://cygwin.com/ml/cygwin/2020-02/msg00197.html