[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#18858: 24.4; tramp vc-registered errors after upgrading to 24.4
From: |
Wolfgang Jenkner |
Subject: |
bug#18858: 24.4; tramp vc-registered errors after upgrading to 24.4 |
Date: |
Tue, 28 Oct 2014 05:43:51 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (berkeley-unix) |
On Mon, Oct 27 2014, Joseph Mingrone wrote:
> C-x C-f /remote-host:/some/path/file
>
> In the minibuffer I see "Tramp: Checking `vc-registered' for
> /scp:phe:/home/jrm/input.tre" (then an indefinitely rotating '/').
>
> When I cancel with C-g, then try again visiting the file again
> everything works. If I try again it will fail again.
>
> I've attached the contents of the tramp buffers. I've reproduced the
> problem on other hosts also running FreeBSD (amd64 9.3).
I have been running tramp with a local patch for this for a while now
(and forgot about it). The tramp bug is in code which is only used if
sending "stty -echo" to the remote /bin/sh leaves echoing on, in effect.
In FreeBSD this happens with /bin/sh if line editing via libedit is used
and emacs or vi bindings are enabled (see also bug#10295).
Date: Sat, 8 Mar 2014 16:14:10 +0100
Subject: [PATCH] Fix hang in `tramp-sh-handle-vc-registered'.
---
lisp/net/tramp-sh.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 315bc08..4a25980 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4763,6 +4763,17 @@ function waits for output unless NOOUTPUT is set."
(when (tramp-get-connection-property p "remote-echo" nil)
;; We mark the command string that it can be erased in the output buffer.
(tramp-set-connection-property p "check-remote-echo" t)
+ ;; If we put `tramp-echo-mark' after a trailing newline (which
+ ;; is assumed to be unquoted) `tramp-send-string' doesn't see
+ ;; that newline and adds `tramp-rsh-end-of-line' right after
+ ;; `tramp-echo-mark', so the remote shell sees two consecutive
+ ;; trailing line endings and sends two prompts after executing
+ ;; the command, which confuses `tramp-wait-for-output'.
+ (when (and (not (string= command ""))
+ (string-equal (substring command -1) "\n"))
+ (setq command (substring command 0 -1)))
+ ;; No need to restore a trailing newline here since `tramp-send-string'
+ ;; makes sure that the string ends in `tramp-rsh-end-of-line', anyway.
(setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark)))
;; Send the command.
(tramp-message vec 6 "%s" command)
--
2.1.2