Never able to get emacs TRAMP mode working reliably, I'd dismissed it as yet another hacky elisp mode that might be fun as a proof of concept, but wasn't worth the hassle. I had used its predecessor AngeFtp, which was usable, but slow.

Besides, wasn't network transparency the proper, abstract way to solve remote file access? NFS, Samba or sshfs were obviously the right solution for this problem.


if [ $TERM = dumb ]; then
 	unsetopt zle
fi
The solution turned out to be simple.

As it turns out, Zsh's line editor confuses TRAMP-mode, which needs an interactive shell, but prefers a very dumb one.

And it is surprisingly comfortable. Network transparency is, of course, a leaky abstraction. Using one of Emacs' git interaction modes (either vc mode or magit) on sshfs causes everything to slow to a crawl.

Why? Because Emacs, which doesn't know the files are on a server with a high latency, will start a git process that doesn't know the files are on a server with a high latency, which will proceed to do a lot of slow disk accesses.

Using tramp will cause emacs to do the right thing automatically: start a git process over ssh, allow it to do disk operations on the remote server, then send back its results. Almost instantaneous.