From 844200a06f2b5d27955c39c05163711e9263bb99 Mon Sep 17 00:00:00 2001 From: Vika Date: Fri, 30 Aug 2019 00:28:57 +0300 Subject: 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. --- nixos/modules/programs/bash/bash.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') 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 -- cgit 1.4.1