public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Rare character glitch in pty?
@ 2023-07-20  6:33 Thomas Wolff
  0 siblings, 0 replies; only message in thread
From: Thomas Wolff @ 2023-07-20  6:33 UTC (permalink / raw)
  To: cygwin

There was a report that on switching terminal windows with the mouse,
focus event reports (as enabled with ESC[?1004h) would sometimes get 
mangled.
This is further described in issue reports to mintty/wsltty 
(https://github.com/mintty/wsltty/issues/335) and also to tmux 
(https://github.com/tmux/tmux/issues/3601).

I could reproduce the issue without either of tmux or WSL. However, it 
happens only once in a few hundred instances:
The escape sequence is changed so that the initial ESC is replaced by 
one of the two subsequent characters, so instead of ESC[O, either of [[O 
or sometimes O[O would be sent to the foreground application.

I traced the issue down to the pty that connects mintty and its client 
application, verified that the correct sequence is passed into write() 
at the pty and the mangled sequence appears at read() in the client 
process. In addition to a minimised test program that behaves like `cat 
-v`, I also also put the test output directly into the client process 
within the mintty code.
This leaves the only conclusion that the issue must be happening somehow 
within pty handling, maybe in the context of some timing condition or 
Windows messages being passed to mintty.
Anyhow, I was about to prepare testing with older mintty versions, in 
case I overlooked something, when the OP reported that the issue does 
not happen with cygwin 3.2.0.
Is there any recent change that could possibly cause such weird behaviour?
Thomas

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-20  6:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20  6:33 Rare character glitch in pty? Thomas Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).