- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support extended mouse clicks beyond 223 #2662
Comments
Currently, at least the following terminal emulators have support for these:
I'll file feature requests for the authors of other well-known terminals (including xterm) to implement at least the urxvt extension.
Given the reasons above how horribly broken the xterm extension is, my plan is to implement support for the urxvt extension only in MC. I'll come back as soon as I have a patch. |
Oh yes you're right, I didn't find that one. |
First patch attached, please take a look :)
Expected behavior:
Right now I could only test it on iterm2, but urxvt really should behave the same. |
So apparently 255-32 = 223, and not 231. Sorry it seems I can't do maths :D |
|
patch for xterm to allow generate mouse ESC-sequence beyond 223 col.
|
so... Konsole, gnome Termital do not support this feature... |
The xterm patch you inlined made it into xterm-262, and only supports the broken extension (which is not compatible with my MC patch). I made a patch yesterday to add urxvt-extension to xterm and sent it to the author; for the record I also attach it here.
gnome-terminal patch is here: http://bugzilla.gnome.org/show_bug.cgi?id=662423 |
|
|
Patch updated to address the warning of comment 7. |
And just for reference, the Konsole ticket is here: http://bugs.kde.org/show_bug.cgi?id=285984 |
|
(A word about GNU Screen: It seems that screen doesn't forward any escape sequence it is not familiar with, including the request to switch to the urxvt 1015 mode. This means that MC with this urxvt patch should make no difference inside screen: mouse will still only work up to 223. This is good news for me because I was afraid that something might break inside screen, but luckily nothing breaks. I'll see if I can patch screen to properly forward the urxvt 1015 request, as well as the new style coordinates.) |
Tmux ticket: https://sourceforge.net/tracker/?func=detail&aid=3435156&group_id=200378&atid=973265 |
Thanks. Applied with trivial changes.
Branch: 2662_extended_mouse_clicks (parent: master).
But I'd note that urxvt >= 9.10 is required to support mouse clicks beyond 223. |
Thanks Andrew!
Yes currently urxvt >= 9.10 or iTerm2 is needed. Hopefully other terminals will follow, e.g. in the gnome-terminal ticket they already had a quite positive response.
I hope you don't mind if I keep this ticket as a starting point for keeping track of generic support of this feature in terminals and maybe other apps as well. |
egmont: |
|
angel_li: I'll take a look, I guess it's not hard, I just have to find some spare time :) |
|
The change broke Ctrl+Space (directory size calculation), it causes mc to hang.
That key combo sends a 0 byte. parse_extended_mouse_coordinates() looks at the buffer of pending_keys to decide if it is a valid prefix of an extended mouse coordinate, but incorrectly assumes that pending_keys is a 0-terminated buffer. Hence when it includes a 0 as part of its actual content, it always reports that it is a valid prefix, and hence mc waits for the sequence to complete, but it will never complete.
The solution I guess is to use seq_append as the end of the buffer, instead of a 0 value.
I'll try to come up with a patch, but I'm quite busy nowadays. If it's blocking the release then feel free to revert and we'll fix it for the next release.
(I was about to refactor the code a little bit anyways, I promised to write unittests and figured out that for testing it would probably be a better design if the same parse_mouse_coordinates() method was responsible for both the old and the new style coordinates.) |
|
fix for the ctrl+space bug |
I added a patch that seems to work at a first glimpse. I'll keep on using this patch (although apparently I never use Ctrl+Space:)).
I'm still planning to do some refactoring later on to make it less hackish and easier to unittest. |
|
Created branch 2662_fix_space_calculation [2662_fix_space_calculation], parent branch: master.
Review, please. |
|
|
Merged to master:
|
|
(Just FYI: Continuing in ticket #2956) |
Important
This issue was migrated from Trac:
egmont
(@egmontkob)The ancient way of reporting mouse coordinates only supports coordinates up to 231, so if your terminal is wider (or taller, but that's unlikely), you cannot use your mouse in the rightmost columns.
There are two (doh) new extensions to report mouse coordinates beyond 231. It would be nice to add support for them to MC.
I'm planning to come up with a patch as my time permits.
See technical details in the next comment...
Note
Original attachments:
egmont
(@egmontkob) onNov 7, 2011 at 8:26 UTC
egmont
(@egmontkob) onNov 7, 2011 at 11:48 UTC
egmont
(@egmontkob) onNov 7, 2011 at 18:38 UTC
egmont
(@egmontkob) onDec 8, 2011 at 9:00 UTC
The text was updated successfully, but these errors were encountered: