chiark / gitweb /
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 2a7796a6b09479800ec4f0bf40fc353b4a5fbe72..c291fdd365eeeb1f4e0a51d3cc675fed05b80204 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 4969f2933afc0a766ad025a2b4471605a0c76fde..e6b00c0941a0d5dac44487923bf63ad25a496e9e 100644 (file)
@@ -2081,7 +2081,7 @@ (defun mdw-eshell-prompt ()
            (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)