dot/emacs, el/dot-emacs.el: Fix patterns for root prompt.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 23 Dec 2009 10:38:21 +0000 (10:38 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 23 Dec 2009 10:40:24 +0000 (10:40 +0000)
If it's a root prompt on a deficient terminal, it'll have two `>' at the
end.  Of course, if it's on a stale terminal for a non-root session,
it'll only have one, so be careful.

dot/emacs
el/dot-emacs.el

index 2a7796a..c291fdd 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
 
 ;; Make the shell mode aware of my prompt.
 
-(setq shell-prompt-pattern "^[^]#$%>»}\n]*[]#$%>»}] *")
+(setq shell-prompt-pattern "^[^]#$%>»}\n]*\\([]#$%»}]\\|>>?\\) *")
 (setq comint-password-prompt-regexp
       (concat "\\(\\([Ee]nter \\|[Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)"
              "[Pp]assword\\|pass phrase\\):"))
index 4969f29..e6b00c0 100644 (file)
@@ -2081,7 +2081,7 @@ strip numbers instead."
            (eshell/pwd)
            right)))
 (setq eshell-prompt-function 'mdw-eshell-prompt)
-(setq eshell-prompt-regexp "^\\[[^]]+\\]")
+(setq eshell-prompt-regexp "^\\[[^]>]+\\(\\]\\|>>?\\)")
 
 (defalias 'eshell/e 'find-file)
 (defalias 'eshell/w3m 'w3m-goto-url)