aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/tty.h
diff options
context:
space:
mode:
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>2020-08-31 18:48:54 +0900
committerCorinna Vinschen <corinna@vinschen.de>2020-08-31 12:07:09 +0200
commit4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f (patch)
tree525102001cf4dc497e8df7a1c87c376c8f6aa3c4 /winsup/cygwin/tty.h
parenta30cd7a5b95675adf31b6092235b6c1f42c59520 (diff)
downloadnewlib-4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f.zip
newlib-4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f.tar.gz
newlib-4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f.tar.bz2
Cygwin: pty: Disable pseudo console if TERM does not have CSI6n.
- Pseudo console internally sends escape sequence CSI6n (query cursor position) on startup of non-cygwin apps. If the terminal does not support CSI6n, CreateProcess() hangs waiting for response. To prevent hang, this patch disables pseudo console if the terminal does not have CSI6n. This is checked on the first execution of non-cygwin app using the following steps. 1) Check if the terminal support ANSI escape sequences by looking into terminfo database. If terminfo has cursor_home (ESC [H), the terminal is supposed to support ANSI escape sequences. 2) If the terminal supports ANSI escape sequneces, send CSI6n for a test and wait for a responce for 40ms. 3) If there is a responce within 40ms, CSI6n is supposed to be supported. Also set-title capability is checked, and removes escape sequence for setting window title if the terminal does not have the set- title capability.
Diffstat (limited to 'winsup/cygwin/tty.h')
-rw-r--r--winsup/cygwin/tty.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h
index c491d38..4e9199d 100644
--- a/winsup/cygwin/tty.h
+++ b/winsup/cygwin/tty.h
@@ -101,6 +101,9 @@ private:
UINT term_code_page;
DWORD pcon_last_time;
HANDLE h_pcon_write_pipe;
+ bool pcon_cap_checked;
+ bool has_csi6n;
+ bool has_set_title;
public:
HANDLE from_master () const { return _from_master; }