wincent / terminus

🖥 Enhanced terminal integration for Vim
BSD 2-Clause "Simplified" License
463 stars 25 forks source link

Let VIM auto-detect ttymouse when $TERM contains 'xterm' #14

Closed ozankabak closed 5 years ago

ozankabak commented 8 years ago

Fix for Issue #13.

wincent commented 8 years ago

Thanks for the PR and the issue!

Unfortunately where I am testing, autodetection doesn't always work, despite what the docs say. The following with vim -u NONE (no plugins loaded):

Conversely if I start Vim without -u NONE (ie. plugins get loaded, including Terminus, but I've commented out the ttymouse section entirely to see what happens):

So, things would still work for me because I do have mouse_sgr, so ttymouse gets set to sgr. But I worry that this change might not work so well for others who don't have that feature, especially if they use tmux.

As a workaround, can you not just set ttymouse=xterm in ~/.vim/after/plugin/terminus.vim?

ozankabak commented 8 years ago

I tested the proposed change using both an old setup (i.e. tmux 1.4 and VIM 7.3.315) and a new setup (tmux 2.1 and VIM 7.4.1301). I tried both with and without "-u NONE", and it works fine. It correctly detects sgr when available, and falls back to either xterm or xterm2 when not. I don't see how forcing xterm2 is a safer choice than this PR.