-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Mouse codes wrongly sent as SGR coordinates instead of UTF-8 on top/left of terminal #3500
Comments
Show logs please or email them to me privately. |
Here are the logs, made with Terminator. tmux-client-12676.log |
This one seems to be a problem, tmux does not map it to a mouse key:
|
This is not a valid SGR mouse sequence. The column and row positions start at 1, so 0 is out of range. This means tmux does not recognise this as a mouse sequence and treats it as individual key presses, which is why you see it appear at the shell. |
It seems like this is a bug in VTE. But probably tmux should just discard sequences when we can recognise they should be an SGR mouse sequence but are in fact invalid, I'll look at doing this next week. |
Try this please: |
Hi @nicm, Thanks for the patch, I tested and it works. But I'm not sure if that's the best solution to the issue: if I use the wheel on the left, no mouse code is generated, so the wheel does not work here. Wouldn't it better to consider that if |
I'm not sure I like that idea much. What do the VTE developers say about this bug? |
Yeah your fix in tmux could be enough if this is going to be fixed in VTE as well. I didn't ping them about this problem for your info (I don't even know where to do this). |
I tracked this down to a missing check in VTE and filed an issue and a patch: https://gitlab.gnome.org/GNOME/vte/-/issues/2621 |
Great, thanks! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue description
When the terminal or an application sets mouse mode with UTF-8 coordinates, tmux sometimes send SGR coordinates while it's not supposed to (only with the wheel, not buttons).
This happens on top/left of the terminal, when the mouse is approximately between 0 and 5 pixels from the left of the terminal.
See this video inside WeeChat (same problem outside WeeChat):
weird.webm
And also the issue reported against WeeChat: weechat/weechat#1893
Steps to reproduce:
printf "\e[?1005h\e[?1000h"
Current behavior:
Mouse codes are sometimes sent as SGR coordinates:
64;0;4M
for wheel up and65;0;4M
for wheel down.Expected behavior:
Mouse codes are always sent as UTF-8 coordinates everywhere, including when using wheel on top left, like
a!#
for wheel down.Additional notes
Bug is reproduced with:
Bug is NOT reproduced:
As the bug appears only with some terminals and only with tmux, I'm not sure if the problem is actually in tmux only or in the terminals.
But as I can't reproduce the bug at all outside tmux, I think the problem comes at least partially from tmux.
Required information
tmux -V
):tmux 3.3a
uname -sp
):Linux unknown
(Debian unstable)echo $TERM
): outside =xterm-256color
, inside =tmux-256color
The text was updated successfully, but these errors were encountered: