View | Details | Raw Unified | Return to bug 194624 | Differences between
and this patch

Collapse All | Expand All

(-)lisp/net/tramp-sh.el (+11 lines)
Lines 4657-4662 Link Here
4657
    (when (tramp-get-connection-property p "remote-echo" nil)
4657
    (when (tramp-get-connection-property p "remote-echo" nil)
4658
      ;; We mark the command string that it can be erased in the output buffer.
4658
      ;; We mark the command string that it can be erased in the output buffer.
4659
      (tramp-set-connection-property p "check-remote-echo" t)
4659
      (tramp-set-connection-property p "check-remote-echo" t)
4660
      ;; If we put `tramp-echo-mark' after a trailing newline (which
4661
      ;; is assumed to be unquoted) `tramp-send-string' doesn't see
4662
      ;; that newline and adds `tramp-rsh-end-of-line' right after
4663
      ;; `tramp-echo-mark', so the remote shell sees two consecutive
4664
      ;; trailing line endings and sends two prompts after executing
4665
      ;; the command, which confuses `tramp-wait-for-output'.
4666
      (when (and (not (string= command ""))
4667
		 (string-equal (substring command -1) "\n"))
4668
	(setq command (substring command 0 -1)))
4669
      ;; No need to restore a trailing newline here since `tramp-send-string'
4670
      ;; makes sure that the string ends in `tramp-rsh-end-of-line', anyway.
4660
      (setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark)))
4671
      (setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark)))
4661
    ;; Send the command.
4672
    ;; Send the command.
4662
    (tramp-message vec 6 "%s" command)
4673
    (tramp-message vec 6 "%s" command)

Return to bug 194624