tramp-devel
[Top][All Lists]
Advanced

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

Re: Weird behaviour when entering the filename


From: Michael Albinus
Subject: Re: Weird behaviour when entering the filename
Date: Wed, 27 Jan 2010 15:02:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Francis Moreau <address@hidden> writes:

Hi,

>>> I finally installed uuencode/uudecode but it's still failing to read
>>> the remote file, I attached the tramp debug trace.
>>
>> Please apply "M-x tramp-cleanup-all-connections" first. Otherwise,
>> cached values are taken, and we don't see anything (as in this trace).
>
> sorry I forgot to do that.
>
> Attached is the new log.

OK, it is clear now. The good message is: uuencode works.

> 12:53:33.767926 tramp-send-command (6) # ( echo xyzzy | uuencode xxx | 
> uudecode -o - 2>/dev/null; echo tramp_exit_status $? )
> 12:53:33.949511 tramp-wait-for-regexp (6) #
>  
> xyzzy
> tramp_exit_status 0
> ///1e945562e25d0453becf7a3f4c9495b9#$

However, there is the spurious " ^H" at the begin of the output, which
prevents Tramp from recognizing "xyzzy". Something is wrong with your tty.

It isn't a problem when you work interactively, because "^H" is the
erase character, which erases the previous space. But Tramp just sees
the byte sequence.

Well, please try the following patch. It shall work around this
problem. (And don't forget to cleanup Tramp first :-)

--8<---------------cut here---------------start------------->8---
*** /mnt/src/tramp/lisp/tramp.el.~2.765.~       2010-01-23 11:00:19.000000000 
+0100
--- /mnt/src/tramp/lisp/tramp.el        2010-01-27 14:52:32.000000000 +0100
***************
*** 6994,7000 ****

        ;; Did we find something?
        (unless found
!       (tramp-message vec 2 "Couldn't find an inline transfer encoding"))

        ;; Set connection properties.
        (tramp-message vec 5 "Using local encoding `%s'" loc-enc)
--- 6994,7001 ----

        ;; Did we find something?
        (unless found
!       (tramp-error
!        vec 'file-error "Couldn't find an inline transfer encoding"))

        ;; Set connection properties.
        (tramp-message vec 5 "Using local encoding `%s'" loc-enc)
***************
*** 7329,7334 ****
--- 7330,7343 ----
           (found (tramp-wait-for-regexp proc timeout regexp1)))
        (if found
          (let (buffer-read-only)
+           ;; A simple-minded busybox has sent " ^H" sequences.
+           ;; Delete them.
+           (goto-char (point-min))
+           (when (re-search-forward
+                  "\\(.\b\\)+$" (tramp-compat-line-end-position) t)
+             (forward-line 1)
+             (delete-region (point-min) (point)))
+           ;; Delete the prompt.
            (goto-char (point-max))
            (re-search-backward regexp nil t)
            (delete-region (point) (point-max)))
***************
*** 8018,8026 ****
         (let ((dl (tramp-get-remote-path vec))
               result)
           (while (and dl (setq result (tramp-find-executable vec cmd dl t t)))
!            ;; Check parameter.
             (when (zerop (tramp-send-command-and-check
                           vec (format "%s -lnd /" result)))
               (throw 'ls-found result))
             (setq dl (cdr dl))))))
       (tramp-error vec 'file-error "Couldn't find a proper `ls' command"))))
--- 8027,8040 ----
         (let ((dl (tramp-get-remote-path vec))
               result)
           (while (and dl (setq result (tramp-find-executable vec cmd dl t t)))
!            ;; Check parameters.  On busybox, "ls" output coloring is
!            ;; enabled by default sometimes.  So we try to disable it
!            ;; when possible.
             (when (zerop (tramp-send-command-and-check
                           vec (format "%s -lnd /" result)))
+              (when (zerop (tramp-send-command-and-check
+                            vec (format "%s --color=never /" result)))
+                (setq result (concat result " --color=never")))
               (throw 'ls-found result))
             (setq dl (cdr dl))))))
       (tramp-error vec 'file-error "Couldn't find a proper `ls' command"))))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




reply via email to

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