Friday, January 20, 2012

Re: Fwd: Mouse reporting and new standards

Hi Bram, George, others...

A lot happened since you had this discussion about a year ago. Vim has
added support for the urxvt mouse extension, and so did a couple of terminal
emulators (xterm, vte/gnome-terminal, George's iterm2, urxvt of course;
konsole is hopefully the next to join the line).

Unfortunately, this feature (or I'd rather call it bugfix) won't be
available for many users. First, vim has to be configured
--with-features=big which is not the default, so many distributions or users
might miss it. Second, vimrc needs to be updated to contain :set
ttymouse=urxvt, yet again something that's easy to miss. Third, this
ttymouse=urxvt setting is brittle; it breaks mouse support if your terminal
doesn't support the extension, so your vimrc becomes unportable across
various terminal emulators.

Bram, you said you were in favor of automatic detection. Luckily, the urxvt
extension allows this. The escape that switches to the new mode is
recognized by terminals that support it, and is ignored by others. I'm not
aware of any terminal that would misbehave seeing such an unrecognized
escape. The old and new style mouse coordinates, as reported by the
terminal, are distinguishable from each other, so an application doesn't
need to know whether the terminal supports the extension: it just asks the
terminal to switch it on, and then receives mouse events in either the old
or the new format.

In order for clicks beyond 223 to become a mainstream fix that works for all
users, rather than an extra bonus feature for a subset of power users, I
recommend doing the following:

- Make the feature compile by default whenever mouse support is compiled;
- Get rid of ttymouse=urxvt, put the feature of urxvt mouse coordinate
parsing into ttymouse=xterm;
- In case of ttymouse=xterm, make vim recognize both the old standard and
the new urxvt coordinates at the same time.

This way all vim users who have mouse support would automatically get
support for extended coordinates, they wouldn't have to modify their vimrc,
and the feature would be autodetected: it would work on terminals that
support it, while mouse would still work up to col/row 223 on terminals that
don't support the extension.

The same idea is already implemented in Midnight Commander 4.8.1, for
further technical discussions see http://midnight-commander.org/ticket/2662
.

What do you guys think? Should we make these changes so that this fix works
out of the box?

thanks,
egmont


--
View this message in context: http://vim.1045645.n5.nabble.com/Fwd-Mouse-reporting-and-new-standards-tp3378370p5161694.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: