-
Notifications
You must be signed in to change notification settings - Fork 852
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
Textual 2.0.4 plus ghostty "fakes" escape press when mouse crosses window border #5559
Comments
Running with |
Good call; if you don't get the chance before me I'll do that when I'm next at a desk with a free moment. |
Same environment as the initial report, started the application with the mouse cursor over the window, ran up the app, slowly moved the mouse cursor diagonally towards the top edge of the window and exited over the desktop, the notification displayed. Here's the log: keys.log
|
I can't repeat that with Ghosty 1.1.2. But I can see from the logs that when you move the mouse off the terminal it generates a y coordinate of |
Actually, now I can repeat it with 1.1.2 |
As given in the diagnostics I included: 1.1.2. |
I went down a bit of a rabbit hole with this! Interestingly, xterm also reports negative coordinates when using SGR-Pixels (1016), but only when clicking and dragging outside the terminal window. You can experiment with the mouse tracking by running:
From what I've read, it's not clear whether this was deliberate or just an oversight. Some consider negative coordinates a definite bug as it violates the standards (see comment). However it sounds like this behaviour in ghostty is slightly different, which only occurs when the mouse is over the window title bar, if I've understood correctly? I don't have ghostty installed (yet) to test this myself, but it sounds worth reporting this to ghostty (if it hasn't been already) to get their take. |
Interesting @TomJGooding - I also noticed (in Ghostty) if you write some text in an Input, then click and drag and move the cursor outside of the terminal window while dragging, the Input widget also fills up with the codes - which seems to align with what you said. |
With this code:
I see this effect:
Screen.Recording.2025-02-19.at.10.56.58.mov
Testing with Textual 1.0.0 I don't see this. On the other hand I can't recreate it with iTerm and Textual 2.0.4 (haven't had the chance to test other terminals).
While I appreciate this might be specific to a particular pretty new terminal, I thought it worth a heads-up at least.
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: