From: Jason Rumney Date: Sun, 15 Jul 2007 01:00:55 +0000 (+0000) Subject: (comint-simple-send): Concat newline before sending. X-Git-Tag: emacs-pretest-23.0.90~11905 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3af378034d580f0844be9bd6d4dfb264a239741d;p=emacs.git (comint-simple-send): Concat newline before sending. (comint-password-prompt-regexp): Recognize plink's passphrase prompt. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bc94864ac44..61448396b13 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2007-07-15 Jason Rumney + + * w32-fns.el (set-default-process-coding-system): Use dos line ends + for input to cmdproxy on all versions of Windows. + Use dos line ends for input to plink. + + * comint.el (comint-simple-send): Concat newline before sending. + (comint-password-prompt-regexp): Recognize plink's passphrase prompt. + 2007-07-14 Stefan Monnier * emacs-lisp/autoload.el (generated-autoload-file): Autoload the diff --git a/lisp/comint.el b/lisp/comint.el index ddc3a2f503b..17ab13337aa 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -333,12 +333,13 @@ This variable is buffer-local." ;; kinit prints a prompt like `Password for devnull@GNU.ORG: '. ;; ksu prints a prompt like `Kerberos password for devnull/root@GNU.ORG: '. ;; ssh-add prints a prompt like `Enter passphrase: '. +;; plink prints a prompt like `Passphrase for key "root@GNU.ORG": '. ;; Some implementations of passwd use "Password (again)" as the 2nd prompt. (defcustom comint-password-prompt-regexp "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|\ Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\)\ \[Pp]assword\\( (again)\\)?\\|\ -pass phrase\\|\\(Enter\\|Repeat\\|Bad\\) passphrase\\)\ +pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\ \\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'" "*Regexp matching prompts for passwords in the inferior process. This is used by `comint-watch-for-password-prompt'." @@ -1953,11 +1954,16 @@ If this takes us past the end of the current line, don't skip at all." "Default function for sending to PROC input STRING. This just sends STRING plus a newline. To override this, set the hook `comint-input-sender'." - (comint-send-string proc string) - (if comint-input-sender-no-newline - (if (not (string-equal string "")) - (process-send-eof)) - (comint-send-string proc "\n"))) + (let ((send-string + (if comint-input-sender-no-newline + string + ;; Sending as two separate strings does not work + ;; on Windows, so concat the \n before sending. + (concat string "\n")))) + (comint-send-string proc send-string)) + (if (and comint-input-sender-no-newline + (not (string-equal string ""))) + (process-send-eof))) (defun comint-line-beginning-position () "Return the buffer position of the beginning of the line, after any prompt.