]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: pty: Disable pseudo console if TERM does not have CSI6n.
authorTakashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>
Mon, 31 Aug 2020 09:48:54 +0000 (18:48 +0900)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 31 Aug 2020 10:07:09 +0000 (12:07 +0200)
commit4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f
tree525102001cf4dc497e8df7a1c87c376c8f6aa3c4
parenta30cd7a5b95675adf31b6092235b6c1f42c59520
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.
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/spawn.cc
winsup/cygwin/tty.cc
winsup/cygwin/tty.h
This page took 0.03295 seconds and 5 git commands to generate.