chiark / gitweb /
bashrc, emacs, dot-emacs.el: Fix prompts for unusual user names.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 16 Mar 2006 21:10:24 +0000 (21:10 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 16 Mar 2006 21:10:24 +0000 (21:10 +0000)
This is a regression in the centralized configuration.

bashrc
dot-emacs.el
emacs

diff --git a/bashrc b/bashrc
index aa184cee16e65ef5bbd244d398126e9b3de85ece..6fb97f45c2ba6d53b719317d74bdc48d58660579 100644 (file)
--- a/bashrc
+++ b/bashrc
@@ -30,11 +30,20 @@ if [ -t 0 ]; then
 
     if (( EUID == 0 )); then
       left="«" right="»"
-    elif [ "$__mdw_tty" = "`tty`" ]; then
-      left="<" right=">"
     else
-      left="[" right="]"
-      export __mdw_tty="`tty`"
+      case $USER in
+        mdw|mwooding)
+         u="" left="[" right="]"
+         ;;
+       *)
+         u="\\u@" left="{" right="}"
+         ;;
+      esac
+      if [ "$__mdw_tty" = "`tty`" ]; then
+       left="<" right=">"
+      else
+        export __mdw_tty="`tty`"
+      fi
     fi
 
     if [ -z "$SSH_CLIENT" ] &&
@@ -43,7 +52,7 @@ if [ -t 0 ]; then
       sec_l='(' sec_r=')'
     fi
 
-    PS1="$nl$bold$left$sec_l\\h$sec_r \\w$right$unbold"
+    PS1="$nl$bold$left$sec_l$u\\h$sec_r \\w$right$unbold"
     PS2="$PS1 $bold>$unbold "
   fi
 
index 0ff6020570e308bac3b031b013d8a9369c36dce6..8674c1ac7c6bfc8a95cc3a69725c7c45bdd0f4c9 100644 (file)
@@ -1750,7 +1750,7 @@ (defun mdw-sh-mode-setup ()
            'comint-watch-for-password-prompt))
 
 (defun mdw-term-mode-setup ()
-  (setq term-prompt-regexp "^[^]#$%>»\n]*[]#$%>»] *")
+  (setq term-prompt-regexp "^[^]#$%>»}\n]*[]#$%>»}] *")
   (make-local-variable 'mouse-yank-at-point)
   (make-local-variable 'transient-mark-mode)
   (setq mouse-yank-at-point t)
diff --git a/emacs b/emacs
index 2b74aefc4b75447759ddd569c2672a413e9c505b..28b3334dcc994a67511b54e57febdabd2ce57d47 100644 (file)
--- a/emacs
+++ b/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 "\\(\\([Oo]ld \\|[Nn]ew \\|[a-zA-Z0-9_]*'s \\|^\\)"
              "[Pp]assword\\|pass phrase\\):\\s *\\'"))