diff options
author | Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com> | 2020-05-31 08:53:20 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2020-05-31 11:33:55 +0300 |
commit | d212bdc40096fde87b086290ac34b1cc6517b19f (patch) | |
tree | 044e7bb233bc925d2bf7e63012fb9395bbd7b58f | |
parent | ac1f63ef2812093ce0e053dd505b44c55c3d47d6 (diff) |
Cygwin: pty: Revise the code which prevents undesired window title.
- In current pty, the window title can not be set from non-cygwin
program due to the code which prevents overwriting the window
title to "cygwin-console-helper.exe" in fhandler_pty_master::pty_
master_fwd_thread(). This patch fixes the issue.
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index c3d49968d..e434b7878 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -3313,9 +3313,14 @@ fhandler_pty_master::pty_master_fwd_thread () } else if (state == 4 && outbuf[i] == '\a') { - memmove (&outbuf[start_at], &outbuf[i+1], rlen-i-1); + const char *helper_str = "\\bin\\cygwin-console-helper.exe"; + if (memmem (&outbuf[start_at], i + 1 - start_at, + helper_str, strlen (helper_str))) + { + memmove (&outbuf[start_at], &outbuf[i+1], rlen-i-1); + rlen = wlen = start_at + rlen - i - 1; + } state = 0; - rlen = wlen = start_at + rlen - i - 1; continue; } else if (outbuf[i] == '\a') |