[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp mosh method

From: Michael Albinus
Subject: Re: Tramp mosh method
Date: Mon, 31 Dec 2012 12:01:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Ted Zlatanov <address@hidden> writes:

> Unfortunately even if TERM=dumb, mosh keeps sending ANSI escape
> sequences, so I don't have that above as there's no point.
> See attached for a partial filter implementation.  It wipes color
> sequences and cursor hide/show, and generally converts positional escape
> sequences to \n.  I think it needs much more awareness of the 25x80
> screen, though, so I may make it smarter if necessary.  If you try it,
> Tramp will lock in a loop checking for remote echo.  Is that because the
> screen updates need to be smarter (e.g. redrawing a line should resend
> the whole line)?  If so I will work on the filter improvements, but I
> wanted to make sure the implementation otherwise is OK, especially the
> `tramp-login-args' above.

I've played a while with the filter, but still not successful. Finally,
I have used the following entry for "mosh" in `tramp-methods':

--8<---------------cut here---------------start------------->8---
    (tramp-login-program        "mosh")
    (tramp-login-args           (("-n") ("-p" "%p") ("--") ("%h")
                                    "env TERM='%s' PS1='%s' /bin/sh -i"
    (tramp-remote-shell         "/bin/sh")
    (tramp-remote-shell-args    ("-c"))
    (tramp-copy-keep-date       t)
    (tramp-copy-recursive       t)
    (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
                                 ("-o" "UserKnownHostsFile=/dev/null")
                                 ("-o" "StrictHostKeyChecking=no")))
    (tramp-process-precommands  ("stty rows 25 cols 80 sane"
                                 ,(format "TERM='%s'" tramp-terminal-type)))
    (tramp-process-filter       tramp-mosh-process-filter)
    (tramp-default-port         22)))
--8<---------------cut here---------------end--------------->8---

Note, that I have moved some settings to `tramp-process-precommands';
you don't need to apply them somewhere else in the code. Setting
"TERM=dumb" is redundant now; but it does not help :-( Maybe one needs
to start mosh-server with that directly.

I believe, we could also learn from `term-emulate-terminal' of term.el,
how to handle ANSI escape sequences proper.

> Thanks for your help!
> Ted

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]