dot/shell-rc: Only deploy the trivial prompt if not directly under Emacs.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 23 Mar 2018 10:27:13 +0000 (10:27 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 23 Mar 2018 10:31:46 +0000 (10:31 +0000)
This lets TRAMP keep working -- which was the point of this hack --
without defeating complex prompts in Emacs `M-x shell' and similar.

dot/shell-rc

index 4538bc3..4ab0355 100644 (file)
@@ -74,8 +74,8 @@ __mdw_set_prompt_pieces () {
 }
 
 __mdw_set_prompt () {
-  case "$TERM" in
-    dumb)
+  case "$TERM:$INSIDE_EMACS" in
+    dumb:)
       case $(id -u) in 0) PS1='# ' ;; *) PS1='$ ' ;; esac
       PS2='> '
       ;;