我的典型开发环境是在全屏终端(通常是gnome-terminal)中运行带有vim的GNU screen会话。 我遇到的问题是,当在vim中单击超过大约第223个字符的字符时,鼠标指针无法正确解释。
我尝试了另一个问题的解决方案(将set ttymouse=sgr
添加到我的.vimrc
),这解决了直接在终端中运行vim的问题,但在screen会话中使用vim时仍存在鼠标限制。
我的典型开发环境是在全屏终端(通常是gnome-terminal)中运行带有vim的GNU screen会话。 我遇到的问题是,当在vim中单击超过大约第223个字符的字符时,鼠标指针无法正确解释。
我尝试了另一个问题的解决方案(将set ttymouse=sgr
添加到我的.vimrc
),这解决了直接在终端中运行vim的问题,但在screen会话中使用vim时仍存在鼠标限制。
在寻找GNU screen sgr支持时,我发现了一个补丁!以下是我用于将补丁应用于Ubuntu 14.04上的screen的步骤。(我修改了该补丁以使其适用于从此处下载的源文件)
Pull down the screen source from apt-get:
apt-get source screen
cd
into the source directory and install the patch:
patch -p1 < screen-sgr-patch.diff
Integrate local changes made by the patch:
dpkg-source --commit
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)
Install the patched screen package (you'll find this beside the source directory):
dpkg -i screen_<version>_<arch>.deb