Wednesday, April 22, 2009

DISPLAY causes vi (vim) to hang...

Ran into a problem the other day that whenever I SSH'ed from hoe into a system at work and ran vi (OK, it's actually vim, but I'm old school and know it as "vi"), vi just hung. It took a good old ^C interrupt to get it to respond.

I ran "strace vi file" and saw it was hanging on the network.

Huh? It wasn't a network filesystem, so why is vi hanging on the network?

Well, on a hunch, I unset my DISPLAY environment variable:

% env | grep DISPLAY
% unsetenv DISPLAY

And then things worked fine.

So vi was trying to do some X11 thing and was getting blocked by my ISP or my NAT router or something between me and work. What the heck vi (vim) is trying to do X11 I don't know....