Doh! I accidentally sent this directly to Bram, instead of to list :/

Bram Moolenaar wrote:

>> I'm guessing that a problem for this, might be the fact that if vim
>> detects xterm-ish terminals, it automatically tries the t_RV sequence
>> out, which isn't dependably valid for screen.
>>
>> If this is the case, perhaps there could be a "vim_might_be_xterm()",
>> which could set ttymouse to "xterm", on the off-chance that the terminal
>> may send it xterm-style mouse sequences, but leave t_RV empty so that it
>> doesn't risk sending unrecognized stuff that the terminal may choose to
>> display directly?
>>
>> The thing is, is that users of screen are able to use some other
>> programs, such as elinks, and will wonder why vim can't work just as
>> well. Are there any real impediments to it doing so?
>>
>> I suspect that my solution could actually be made much more simple by
>> simply assuming that all terms "might be xterm", thus eliminating the
>> need to actually implement a function (just set ttymouse to xterm by
>> default, again leaving t_RV).
>
> There doesn't appear to be a standard for mouse escape sequences.  And
> termcap/terminfo is too limited for the features of modern terminal
> emulaters.  That means the only choice for Vim is to implement mouse
> support for each terminal separately.  If screen uses the same codes as
> xterm then this should be relatively simple.

The de facto standard (aside from the limited support that /is/ offered
via terminfo) would seem to be xterm... plus maybe whatever it is that
gpm uses.

> It's about time termcap/terminfo gets updated to support the features we
> need, instead of hacking solutions in all programs.  I'm afraid I don't
> have time for this (the original development of termcap was closely
> related to the early development of vi).

But you already have hacked support into your programs for mouse
support. Now that you've done that, couldn't you just open it up a bit?
Is there anything wrong with always recognizing the appropriate xterm
sequences (provided that they don't first match a valid terminfo entry)?
This is the approach that elinks seems to take, and I don't see any
particular reason why vim couldn't do this as well.

I agree that fixing terminfo is the right solution, but that doesn't
mean you shouldn't hack the working solution in now. You have already
done so, or you wouldn't have any mouse support for the various
xterm-like consoles in the first place.

I'd be happy to write the patch (it should be pretty straightforward); I
just want to get some agreement on the correct action to take.

-- 
Thanks,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to