tramp-devel
[Top][All Lists]
Advanced

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

Re: Tramp mosh method


From: Ted Zlatanov
Subject: Re: Tramp mosh method
Date: Sun, 23 Dec 2012 16:58:02 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

On Fri, 21 Dec 2012 20:42:44 +0100 Michael Albinus <address@hidden> wrote: 

MA> Ted Zlatanov <address@hidden> writes:
>> With your code that works for you, from Debian to CentOS, I'm getting a
>> hang (only `C-g' aborts) to localhost or to wd01, and mosh-client is
>> running so the "mosh" command is hanging without output.  The level 10
>> debug log is below.  I don't see any output from the process filter.
>> Weird.

MA> Please use tramp-verbose 10. For me it is hanging as well; your filter
MA> implementation is missing :-)

OK.  I had it set to 9 and was convinced it was 10.  Sorry.

I added some improvements to the "mosh" `tramp-login-args' to set the
prompt even if the TERM is not dumb:

#+begin_src lisp
(add-to-list 'tramp-methods
  '("mosh"
    (tramp-login-program        "mosh")
    (tramp-login-args           (("-p" "%p") ("--") ("%h")
                                 ("/bin/env" "PS1=% " "/bin/sh")))
    (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" "stty cols 80"))
    (tramp-process-filter       tramp-mosh-process-filter)
    (tramp-default-port         22)))

#+end_src

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.

Thanks for your help!
Ted



reply via email to

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