diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2577f7fe02f..731a71a9f49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-11-01 Wolfgang Jenkner <wjenkner@inode.at> | ||
| 2 | |||
| 3 | * net/tramp-sh.el (tramp-send-command): Fix the case where the | ||
| 4 | remote-echo connection property is non-nil (bug#18858). | ||
| 5 | |||
| 1 | 2014-11-01 Michael Albinus <michael.albinus@gmx.de> | 6 | 2014-11-01 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | Backport Tramp changes from trunk. | 8 | Backport Tramp changes from trunk. |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1976e0e7f66..186a51c5bb8 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -4769,6 +4769,17 @@ function waits for output unless NOOUTPUT is set." | |||
| 4769 | (when (tramp-get-connection-property p "remote-echo" nil) | 4769 | (when (tramp-get-connection-property p "remote-echo" nil) |
| 4770 | ;; We mark the command string that it can be erased in the output buffer. | 4770 | ;; We mark the command string that it can be erased in the output buffer. |
| 4771 | (tramp-set-connection-property p "check-remote-echo" t) | 4771 | (tramp-set-connection-property p "check-remote-echo" t) |
| 4772 | ;; If we put `tramp-echo-mark' after a trailing newline (which | ||
| 4773 | ;; is assumed to be unquoted) `tramp-send-string' doesn't see | ||
| 4774 | ;; that newline and adds `tramp-rsh-end-of-line' right after | ||
| 4775 | ;; `tramp-echo-mark', so the remote shell sees two consecutive | ||
| 4776 | ;; trailing line endings and sends two prompts after executing | ||
| 4777 | ;; the command, which confuses `tramp-wait-for-output'. | ||
| 4778 | (when (and (not (string= command "")) | ||
| 4779 | (string-equal (substring command -1) "\n")) | ||
| 4780 | (setq command (substring command 0 -1))) | ||
| 4781 | ;; No need to restore a trailing newline here since `tramp-send-string' | ||
| 4782 | ;; makes sure that the string ends in `tramp-rsh-end-of-line', anyway. | ||
| 4772 | (setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark))) | 4783 | (setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark))) |
| 4773 | ;; Send the command. | 4784 | ;; Send the command. |
| 4774 | (tramp-message vec 6 "%s" command) | 4785 | (tramp-message vec 6 "%s" command) |