summaryrefslogtreecommitdiff
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2007-07-22 22:55:09 +0000
committerJason Rumney <jasonr@gnu.org>2007-07-22 22:55:09 +0000
commitd93290ed100772393a6ced91c49675e169b58ea3 (patch)
tree13c7cb1b5f9482c4e0f917af9eadd6818c584cc2 /lisp/comint.el
parent4fc066e16472fe985ebc34eb9b2b4e37a53a074c (diff)
downloademacs-d93290ed100772393a6ced91c49675e169b58ea3.tar.gz
(comint-simple-send): Concat newline before sending.
(comint-password-prompt-regexp): Recognize plink's passphrase prompt.
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 7d81f357e22..43d12946fce 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.