Subject: bug#24039: 24.5; emacs shell doesn't work with mosh

From: Michael Albinus <[email-masked]>
Date: Wed, 20 Jul 2016 22:10:04 +0200

Nico Schottelius <[email-masked]> writes:

> Starting M-x shell and afterwards entering "mosh mymachine" results into
> mosh crashing with:
>
> mosh-server: terminalframebuffer.cc:73:
> Terminal::Framebuffer::Framebuffer(int, int): Assertion `s_height > 0'
> failed.
>
> I suspect that the window height is not being exposed in a standard
> terminfo way to be consumed by mosh.

Emacs' `shell' sets $TERM to "dumb", which isn't what mosh expects. Try
"M-x ansi-term", and call "mosh mymachine" from there. This works, at
least for me.

> Furthermore escapes from bash and zsh are displayed as
>
> [J[16:58] wurzel:~% [?2004
>
> (where wurzel is my hostname and 16:58 is the time)

Same reason. Teach your .profile or .bashrc or .zshrc not to use escape
sequences. Use something like this:

if test $TERM = "dumb"
   # set prompt w/o escape sequences
else
   # set default prompt
end

Best regards, Michael.