tramp-devel
[Top][All Lists]
Advanced

[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, 03 Sep 2012 15:42:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Tassilo Horn <address@hidden> writes:

> Hi all,

Hi Tassilo,

> I tried to find-file /mosh:address@hidden:/home<TAB>, and that's what I
> get in the *debug tramp/mosh address@hidden buffer.  (Well, I TAB-ed
> more than once, so the messages might be a bit more longish than
> needed.)
>
> In *Messages* I get "byte-code: Host `tsdh.org' looks like a remote
> host, `mosh' can only use the local host".

That's simple to fix:

--8<---------------cut here---------------start------------->8---
*** ~/src/tramp/lisp/tramp-sh.el.~2.81~ 2012-09-03 15:25:57.740895595 +0200
--- ~/src/tramp/lisp/tramp-sh.el        2012-09-03 15:13:43.631022840 +0200
***************
*** 406,411 ****
--- 406,418 ----
      (tramp-copy-program         "fcp")
      (tramp-copy-args            (("-p" "%k")))
      (tramp-copy-keep-date       t)))
+ ;;;###tramp-autoload
+ (add-to-list 'tramp-methods
+   '("mosh"
+     (tramp-login-program        "env LC_ALL=en_US.UTF-8 /usr/bin/mosh")
+     (tramp-login-args           (("-p" "%p") ("address@hidden")))
+     (tramp-remote-shell         "/bin/sh")
+     (tramp-remote-shell-args    ("-c"))))

  ;;;###tramp-autoload
  (add-to-list 'tramp-default-method-alist
***************
*** 4258,4263 ****
--- 4265,4272 ----
           ;; The host name is used for the remote shell command.
           (member
            '("%h") (tramp-get-method-parameter method 'tramp-login-args))
+          (member
+           '("address@hidden") (tramp-get-method-parameter method 
'tramp-login-args))
           ;; The host is local.  We cannot use `tramp-local-host-p'
           ;; here, because it opens a connection as well.
           (string-match tramp-local-host-regexp host))
***************
*** 4378,4383 ****
--- 4387,4398 ----
                 p 60
                 "Couldn't find local shell prompt %s" tramp-encoding-shell)

+               ;; "mosh" needs a row size > 0.
+               (tramp-message vec 6 "%s" "stty rows 40 columns 80")
+               (tramp-send-string vec "stty rows 40 columns 80")
+               (tramp-barf-if-no-shell-prompt
+                p 5 "Couldn't find local shell prompt")
+
                ;; Now do all the connections as specified.
                (while target-alist
                  (let* ((hop (car target-alist))
--8<---------------cut here---------------end--------------->8---

However, mosh requires an interactive tty, and it swamps the Tramp
connection buffer with escape sequences then (you see it in the debug
buffer, when `tramp-verbose' is set to 10). I have no real idea how to
fix this.

> Bye,
> Tassilo

Best regards, Michael.



reply via email to

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