emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117653: * net/tramp-sh.el (tramp-send-command):


From: Michael Albinus
Subject: [Emacs-diffs] emacs-24 r117653: * net/tramp-sh.el (tramp-send-command): Fix the case where the
Date: Sat, 01 Nov 2014 14:08:05 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117653
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18858
author: Wolfgang Jenkner <address@hidden>
committer: Michael Albinus <address@hidden>
branch nick: emacs-24
timestamp: Sat 2014-11-01 15:08:00 +0100
message:
  * net/tramp-sh.el (tramp-send-command): Fix the case where the
  remote-echo connection property is non-nil.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-11-01 13:34:45 +0000
+++ b/lisp/ChangeLog    2014-11-01 14:08:00 +0000
@@ -1,3 +1,8 @@
+2014-11-01  Wolfgang Jenkner  <address@hidden>
+
+       * net/tramp-sh.el (tramp-send-command): Fix the case where the
+       remote-echo connection property is non-nil (bug#18858).
+
 2014-11-01  Michael Albinus  <address@hidden>
 
        Backport Tramp changes from trunk.

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-11-01 13:34:45 +0000
+++ b/lisp/net/tramp-sh.el      2014-11-01 14:08:00 +0000
@@ -4769,6 +4769,17 @@
     (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)


reply via email to

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