Home » Questions » Computers [ Ask a new question ]

Vim and mouse with ssh from Mac to Linux

Vim and mouse with ssh from Mac to Linux

I certainly know it's possible to make the mouse work in Vim on a remote session to a Linux machine from my Mac, but I haven't figured out just how.

Asked by: Guest | Views: 335
Total answers/comments: 2
Guest [Entry]

"I don't think that Terminal.app supports xterm mouse reporting which is needed to make the mouse work. There are a few options to getting a terminal with mouse reporting functionality.

iTerm is an alternative terminal program that support mouse reporting
MouseTerm is a hack to add mouse reporting to Terminal.app but I've not tried it and don't know how well it works
You can also install X11 and use a real xterm

Once you've got one of those going, :set mouse=a (you might also need to :set term=xterm) and you should be in business."
Guest [Entry]

"I don't have the answer, but I can share what I have learned in my months long search for the answer. I'm a heavy user of vim and GNU screen over ssh. Somewhat ironically, I swear by those programs because I can use them remotely without a mouse, but I have nearly abandoned OS X because it doesn't provide an easy way for me to use them remotely with a mouse.

Anyhow, here is what I have turned up:

xterm running under X11.app can be made to report mouse events and work as desired. Unfortunately, xterm lacks many of iTerm and Terminal.app's features. Doing something as simple changing the font in xterm requires a bit of black magic.
iTerm can supposedly accommodate the desired functionality, but I have never gotten it to work. iTerm also suffered from major performance issues when I jumped ship to Terminal.app a couple months ago. Screen updates happened slowly, and it would take up 25% CPU just sitting there doing nothing.
I actually tried using a stripped down Ubuntu VM running under VMWare as my terminal app. I set it up to boot into a fullscreen Gnome-Terminal with fluxbox as the window manager. I gave up on that solution because it didn't play nice with Spaces and the overhead of running VMWare.

Now I just never stray far from a real Linux box occasionally use vim through Terminal.app to keep me honest - if I can't remember the navigation keystrokes, I might as well be using Visual Studio."