Re: [dev] st mouse support beyond column 223

From: Egmont Koblinger <egmont_AT_gmail.com>
Date: Sat, 26 Jan 2013 15:53:10 +0100

Hi Christoph,

Thanks for applying! Works correctly for me from git.

A couple of ways of testing:

Vim:
- Get newest vim (7.3.785 - you need to download and apply the 785 patches
individually from ftp://ftp.vim.org/pub/vim/patches/7.3/ )
- ./configure --with-features=big; make install
- put this in .vimrc:
:set mouse=a
:set ttym=sgr
- edit a wide file in a wide st window, make sure mouse clicks work even
beyond column 223.

Emacs:
- Download and compile development snapshot from
ftp://alpha.gnu.org/gnu/emacs/pretest/
- unset DISPLAY
- Start emacs, mouse beyond col 223 should just work out of the box

Tmux:
- Get tmux 1.7
- Apply the patch from http://sourceforge.net/p/tmux/tickets/26/?page=1
- Place this in .tmux.conf:
setw -g mode-mouse on
- Make st window about 300-400 chars wide.
- Start tmux, split the tmux window vertically with Ctrl-B %.
- Start any mouse-aware app in the right hand side. The app doesn't need to
know the 1006 extension. Mouse should work everywhere.

I've added htop to the list of applications that should be patched for 1006
support :)


cheers,
egmont


On Sat, Jan 26, 2013 at 3:14 PM, Christoph Lohmann <20h_AT_r-36.net> wrote:

> Greetings.
>
> On Sat, 26 Jan 2013 15:14:22 +0100 Egmont Koblinger <egmont_AT_gmail.com>
> wrote:
> > Hi guys,
> >
> > The original mouse protocol for terminals encodes the coordinates as a
> > single byte (plus 32) hence only allows coordinates up to 223.
> >
> > Xterm's SGR 1006 extension changes to a different format which allows
> > arbitrary coordinates. This extension is getting widely adopted across
> > terminals (e.g. xterm, vte, konsole, iterm2, putty...), as well as
> > applications (vim, emacs...). Tmux has a patch too:
> > http://sourceforge.net/p/tmux/tickets/26/?page=1
> >
> > Please see my patch, it adds support for this extension. Furthermore, if
> > the extension is turned off, it modifies the behavior of post-223 clicks:
> > it makes it report nothing rather than bogus coordinates.
> >
> > (To make the story more complicated, there was a first extension (1005)
> > made by xterm, which is terribly broken, then a second one (1015) by
> urxvt,
> > which is kinda okay, and this is the third one. It looks pretty much
> that
> > this is going to be the "winning" one. For the sake of simplicity I only
> > added support for this latter, but it might be very easy to support 1015
> > too. On the application front, currently Midnight Commander uses this
> 1015
> > extension, but I will ask them (send them patch) to switch to the newer
> > 1006 mode. Let me know if you'd prefer to support 1006 too, it can be
> > added in practically no time.)
> >
> > I hope you like my patch, let me know if you have any questions.
>
> Your patch is applied. But I had to modify it because your patch is
> against 0.3, but git has moved fast.
>
> What is your test case for this? A big htop window where you click in?
>
> Please try out if it works for you in the latest st from the git reposiā€
> tory.
>
>
> Sincerely,
>
> Christoph Lohmann
>
>
>
Received on Sat Jan 26 2013 - 15:53:10 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 26 2013 - 16:00:06 CET