about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorVika <kisik21@fireburn.ru>2019-08-30 00:28:57 +0300
committerVika <kisik21@fireburn.ru>2019-08-30 00:28:57 +0300
commit844200a06f2b5d27955c39c05163711e9263bb99 (patch)
tree024627a4cdfe251809dc8f056f1a1c51181805ed /nixos
parentf86bbb218cacd968aecdd1374a42d23262c23d3b (diff)
downloadnixlib-844200a06f2b5d27955c39c05163711e9263bb99.tar
nixlib-844200a06f2b5d27955c39c05163711e9263bb99.tar.gz
nixlib-844200a06f2b5d27955c39c05163711e9263bb99.tar.bz2
nixlib-844200a06f2b5d27955c39c05163711e9263bb99.tar.lz
nixlib-844200a06f2b5d27955c39c05163711e9263bb99.tar.xz
nixlib-844200a06f2b5d27955c39c05163711e9263bb99.tar.zst
nixlib-844200a06f2b5d27955c39c05163711e9263bb99.zip
nixos/bash: Improve Emacs detection for PS1
That's one of my itches - when I'm sshing from Emacs' term to a NixOS
machine, it doesn't detect that I'm running emacs and showing a title
escape sequence. This commit fixes it, checking against $TERM to
prevent this from ever bothering anyone again.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/programs/bash/bash.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix
index a7e57b8608d7..99daec5ff5b7 100644
--- a/nixos/modules/programs/bash/bash.nix
+++ b/nixos/modules/programs/bash/bash.nix
@@ -98,7 +98,7 @@ in
           if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then
             PROMPT_COLOR="1;31m"
             let $UID && PROMPT_COLOR="1;32m"
-            if [ -n "$INSIDE_EMACS" ]; then
+            if [ -n "$INSIDE_EMACS" -o "$TERM" == "eterm" -o "$TERM" == "eterm-color" ]; then
               # Emacs term mode doesn't support xterm title escape sequence (\e]0;)
               PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "
             else