Version: 2.4.5 (using KDE 4.4.5)
Using the legacy method, mouse coordinates can be reported only up to 223. If you have a wider terminal, you cannot use the mouse in the rightmost columns.
There exist two extensions to overcome this problem, a broken one invented by xterm (the "DEC 1005" mode) which is supported by xterm, urxvt and iterm2; and a good one invented by urxvt (the "DEC 1015" mode), supported by urxvt and iterm2.
Please see the http://www.midnight-commander.org/ticket/2662 for a detailed introduction and comparison of the two extensions, for a patch to midnight commander to support the urxvt extension, and for xterm to support this extension. Also please see http://bugzilla.gnome.org/show_bug.cgi?id=662423 for a patch to gnome-terminal (vte) to add support for both extensions.
Please add support for these two extensions (or at least the good "urxvt 1015" extension) to Konsole, too. Based on the similar patches for other terminals, it should be very easy to do it.
Steps to Reproduce:
Compile mc-4.8.0 with the patch at the site linked above. Start it, and make the terminal wider than 223 columns. Try to use mouse in the rightmost columns.
Mouse click coordinates get mangled, i.e. the application believes you clicked somewhere else than you actually did. E.g. you click on "10 Quit" in the bottom right corner, but MC brings up the User menu instead.
Mouse should work perfectly everywhere, even in columns beyond 223.
Technical details at http://www.midnight-commander.org/ticket/2662
Created attachment 65364 [details]
Please see the proposed patch.
It was made against a bit older KDE which I could compile, but it applies cleanly to the newest konsole, so I guess that one works too.
(Note that my patch slightly changes the behavior with the legacy escape sequences: clicking beyond 223 used to send erroneus codes, now it doesn't send anything. I think the new behavior is better.)
This can be very useful for mc users on widescreens and when the konsole window is expanded across multiple monitors. Please merge. =:^)
FYI: as of now, the urxvt extension is supported by at least the following
- vim >= 7.3.343 (configure --with-features=big; echo ":set ttymouse=urxvt" >>.vimrc)
- mc >= 4.8.1 (out of the box, no config needed)
- rxvt-unicode >= 9.10
- xterm >= 277
- vte (gnome-terminal etc.) >= 0.31
- iterm2 (for mac os x)
It would be nice to see konsole in the list too.
The konsole patch w/ the git master of mc didn't seem to work. After the konsole patch, the mouse clicks didn't work anywhere.
I'll look at it later.
Hi Kurt, I'm sorry to hear that the patch didn't work for you. Could you please help me find what went wrong?
Could you try your mc with any of these terminals to see if it works: xterm >= 277, rxvt-unicode >= 9.10, or vte >= 0.31 ?
Instead of mc, could you try vim 7.3 with all the patches from ftp://ftp.vim.org/pub/vim/patches/7.3/ applied in order, ./configure --with-features=big, and having these in your .vimrc:
Could you please try this in your patched konsole and tell what it prints?
$ echo $'\e[?1002h\e[?1015h'; cat
and now click at random places on the screen...
What version of konsole are you compiling?
Thanks a lot for your help!
I've managed to compile konsole-4.7.4 (latest release) and git HEAD (cabce6ae89b5939ad77b3b8202170e7badee7ceb).
4.7.4: The patch applies and still works for me.
HEAD: There were some changes in the code which broke mouse handling at the first place, you cannot click beyond column 95. (I guess it has something to do with the escape sequence not being valid UTF-8 in that case.) The patch doesn't apply so I couldn't test.
Created attachment 68058 [details]
updated to current git head
I've added a new patch for your convenience. It reverts the change that broke mouse beyond column 95 (5143f39), adds comments, and updates indentation of the code. Other than that, it's the same as the previous.
Please test it, I'm eager to hear if it works for you.
Thanks for the patch - I should have realized a previous commit broke the mouse clicks.
Looks good so far.
Git commit b876f2a3edcb63f29588fdde6b20dc6c9d13bc24 by Kurt Hindenburg.
Committed on 21/01/2012 at 19:21.
Pushed by hindenburg into branch 'master'.
Support extended mouse coordinates.
Using the legacy method, mouse coordinates can be reported only up to 223. If
you have a wider terminal, you cannot use the mouse in the rightmost columns.
There exist two extensions to overcome this problem, a broken one invented by
xterm (the "DEC 1005" mode) which is supported by xterm, urxvt and iterm2; and
a good one invented by urxvt (the "DEC 1015" mode), supported by urxvt and
Many thanks to Egmont Koblinger firstname.lastname@example.org for report and patch.
M +32 -2 src/Vt102Emulation.cpp
M +6 -4 src/Vt102Emulation.h