Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling focus does not really work #1

Closed
ShrykeWindgrace opened this issue Aug 6, 2023 · 4 comments
Closed

Disabling focus does not really work #1

ShrykeWindgrace opened this issue Aug 6, 2023 · 4 comments

Comments

@ShrykeWindgrace
Copy link
Collaborator

Strange behavior I spotted on the vty-mode-demo

Initially, there are no focus events at all. When I toggle them on, I start receiving them as VT sequences, which is kind of expected. However, when I then toggle them off, they still arrive, but as Windows Focus Event Records (FocusEventRecordC)! Further toggles do not change the situation, focus event keep coming.

Possible approaches:

  • drop Windows Focus Event Records, expect only VT sequences events
  • understand why the \ESC[?1004l sequence can't disable all Focus Events for real - and why \ESC[?1004h enables too much. Possible Windows Terminal bug?
  • something else?

It seems that the first option is the easiest in terms of efforts/gains ratio.

I am reluctant to implement it without a second opinion, because it could also be an issue with my terminal config somewhere.

@ShrykeWindgrace
Copy link
Collaborator Author

If you want to test locally, the PR jtdaugherty/vty-crossplatform#2 has the code.

@jtdaugherty
Copy link

jtdaugherty/vty-crossplatform#2 is now merged.

@chhackett
Copy link
Owner

chhackett commented Aug 13, 2023

@ShrykeWindgrace
Thanks for explaining the issue. I checked in a fix just implementing your option 1. I was unable to figure out how to toggle those focus events through the Windows API. But since the VT sequences work as designed, I just went with that.

I also did some cleanup:

  • library no longer writes to hardcoded log files in C:\temp
  • you can set an env var 'VTY_DEBUG_LOG' and input sequences and events will get logged there.

@ShrykeWindgrace
Copy link
Collaborator Author

I'll test the changes shortly, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants