[PATCH v10] Cygwin: pty: Disable pseudo console if TERM does not have CSI6n.

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Aug 31 10:12:15 GMT 2020

On Aug 31 18:48, Takashi Yano via Cygwin-patches wrote:
> - 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      |   1 +
>  winsup/cygwin/fhandler_tty.cc | 235 ++++++++++++++++++++++++++++++----
>  winsup/cygwin/spawn.cc        |  18 ++-
>  winsup/cygwin/tty.cc          |   3 +
>  winsup/cygwin/tty.h           |   3 +
>  5 files changed, 230 insertions(+), 30 deletions(-)

Pushed with minor typo fixes (responce -> response, responced ->
responded).  A native english speaker will probably use different
expressions, like (not responded -> not acknowledged) or something,
but I think it's ok as is.

Thanks for your explanations in your other mail!


More information about the Cygwin-patches mailing list