Ssh – Running vim on a remote Linux machine “freezes” OS X SSH connection

iplinuxmacosssh

I am attempting to SSH to a Linux (Fedora 14) machine and then open up vim to edit a file, however on my new Macbook Pro, the SSH session seems to "freeze" as soon as I open vim.

I can login fine to the Linux machine and run commands:

screenshot 1

However as soon as I run vim, the terminal blanks out, and does not respond to :q, ctrl+z, ctrl+c, ctrl+d, etc:

enter image description here

I'm using iTerm2, but the same problem occurs in Terminal.app. Also, attempting to transfer files with scp exhibits the same behavior, so it seems related to any type of ssh-connection to this machine.

Could this have something to do with tty vs pty, or some other terminal emulation setting in OS X?

I do not have the same display problem when opening vim on the remote linux machine using Windows or other OS's. Also, I can use vim fine when connected to other remote (Linux) machines.

Best Answer

I second @Gilles answer. But easier to diagnose, just set the MTU on your ethernet or wireless interface to something really small and see what happens. On OS X:

$ sudo ifconfig en0 mtu 1100  # (or en1 for wifi, unless on an Air)

Then test scp and see what happens. If it still stalls at 1100 you probably need to fix a really broken network device somewhere.

Related Question