4

My typical development environment is running a GNU screen session with vim in a full screen terminal (typically gnome-terminal). The problem I've run into is that the mouse pointer is not interpreted correctly when clicking on a character in vim beyond around the 223rd character in the terminal.

I have tried the solution to another question (adding set ttymouse=sgr to my .vimrc), and this solves the problem for running vim directly in the terminal but the limitation with the mouse still exists when using vim inside a screen session.

Community
  • 1
  • 1
Chisholm
  • 1,046
  • 7
  • 12

1 Answers1

5

After searching for GNU screen sgr support I came across a patch! Here are the steps I used to apply the patch to screen on Ubuntu 14.04. (I've modified that patch to work with the source files downloaded from apt-get here)

  1. Pull down the screen source from apt-get:

    apt-get source screen
    
  2. cd into the source directory and install the patch:

    patch -p1 < screen-sgr-patch.diff
    
  3. Integrate local changes made by the patch:

    dpkg-source --commit
    
  4. Build the new .deb files:

    dpkg-buildpackage -us -uc
    

    (NOTE: it may complain about missing build dependencies but just install any of them using apt-get and run dpkg-buildpackage again)

  5. Install the patched screen package (you'll find this beside the source directory):

    dpkg -i screen_<version>_<arch>.deb
    
Chisholm
  • 1,046
  • 7
  • 12
  • I'm not sure why this patch isn't pulled into screen, but I haven't had any issues using it so far. – Chisholm Jul 11 '14 at 16:14
  • Just so you know you can always flag a moderator to un community wiki your answer. (Although it might take a long time for them to change it) – FDinoff Jul 11 '14 at 19:32