mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.11k stars 104 forks source link

Occasionally print "[[O" or "[[I" abnormally on the screen #335

Closed fengyichui closed 1 year ago

fengyichui commented 1 year ago

Hi,

When I use tmux, occasionally print "[[O" or "[[I" abnormally on the screen. And Windows Terminal do not has this issue.

What can I do to help this?

mintty commented 1 year ago

These are the focus report escape sequences. They are only sent if explicitly enabled with a DECSET 1004 control sequence. If a program enables these reports and does not catch them properly, it is a bug in that program. There may be a race condition if a program disables the reporting (and does not expect it anymore) while a report was already triggered. Please report to tmux.

fengyichui commented 1 year ago

I have reported to tmux, and we check the debug log, tmux just received literally "[[O". The authors of TMUX think this may be a WSL bug. I tested with Windows Terminal for a long time and couldn't find this issue

mintty commented 1 year ago

So there is a tmux issue? Please provide its link.

fengyichui commented 1 year ago

Here: https://github.com/tmux/tmux/issues/3601

fengyichui commented 1 year ago

I use v3.2.0 cygwin1.dll, this issue doesn't seem to happen anymore. cygwin_3.2.0.zip

mintty commented 1 year ago

Thank you for the information, that is very interesting indeed. I was trying to test with mintty versions before reporting to cygwin, and it's quite bothersome to set up a reliable test case for this. What is your current test scenario? How often would it happen? Anyway, if we can establish that the issue does not occur with cygwin 3.2.0, I will prepare a report. Would be good also to work out which cygwin version between 3.2.0 and current 3.4.7 introduced a bug.

fengyichui commented 1 year ago

Today I stumbled upon a backup of my old cygwin and gave it a try.

My test environment still uses the tinytask tool to automate mouse clicks, and the frequency of these clicks is about tens or hundreds of times.

mintty commented 1 year ago

It does not seem to happen with the latest snapshot from http://cygwin.com/snapshots/ which is a 3.4.0 patch version. Neither does it seem to happen with 3.5.0 which can be installed as a test version. Please check that.

fengyichui commented 1 year ago

I test latest snapshot, this issue is happened. I test some older snapshot: cygwin1-20220217.dll is bad, cygwin1-20220127.dll seems good: cygwin1-20220127-good.zip cygwin1-20220217_bad.zip

mintty commented 1 year ago

Hmm, so the newer one is good but the current one bad again? This does not appear consistent, maybe it's just the testing which did not expose the issue because it appears so rarely. Testing 3.5.0 would be helpful. I've tried to create an automatic test scenario to improve the process, which would get feedback from the tracing application to stop once the issue occurs, so you wouldn't have to fiddle interactively with that tool. But it's tricky to build something appropriate...

fengyichui commented 1 year ago

I also tested cygwin-3.5.0-0.341.dll, it is bad. It seems that since the cygwin1-20220217.dll version, there is a problem. Today I'll work with version cygwin1-20220127.dll to see if this version is really good.

mintty commented 1 year ago

The issue is fixed with the latest cygwin test release 3.5.0-0.370, to be released with 3.5.0 (later this year) and 3.4.8.

mintty commented 1 year ago

Cygwin 3.4.8 has been released, with this fix included.

mintty commented 1 year ago

Reopening as this is a wsltty issue, sorry. Next release to come soon.

mintty commented 1 year ago

Released 3.6.5.