Mosh is an alternative to ssh that is generally more resilient. In particular, it can deal with:

  • Extreme packet loss
  • Changing client IPs
  • Temporary connection loss

There are few downsides to using it, other than a lack of X11 forwarding, which TRAMP does not use.

It would be great if we could get emacs to work with it, as it could potentially make TRAMP much more stable in unstable environments.

Some work has already been done to work towards this, but nothing has worked yet.

2 Answers 2


This cannot be done without some changes to mosh.

Unlike ssh, mosh doesn't transmit every character that is sent by the application — it will happily skip sending data that has already scrolled off-screen, and will omit data that has been overwritten by later screen updates over high-RTT links. Therefore, it cannot be easily used for automation.

There has been some talk on the mosh mailing list about adding a reliable command channel to the mosh protocol, but I'm not sure if anything has come out of it.

  • What about mosh+tmux, then (or something in that vein). Wouldn't that satisfy the data-loss issue?
    – PythonNut
    May 21, 2015 at 2:00

I've asked on the mosh ML list for support, see http://thread.gmane.org/gmane.network.mosh.devel/112. The answer was "this is not going to happen any time soon".

  • 4
    Btw, if people are lobbying on the mosh ML for a scripting extension, I would be more than happy to add this as additional method to Tramp when possible. Dec 19, 2014 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.