diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2018-12-18 09:19:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-18 09:19:48 +0000 |
commit | f2180a5367fd21aed192c4b7d0213698a9944f98 (patch) | |
tree | 38665bc81d24d67027d6502af87bd80e7e39f128 /nixos | |
parent | 70658b223620c13ba3587cc24c52016bb1ff292b (diff) | |
parent | b4b67177b53c23c6fb77aea7f0bc5c559f8bebe5 (diff) |
Merge pull request #52458 from tadfisher/emacs-bash-prompt
nixos/bash: Fix prompt regression in Emacs term mode
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/programs/bash/bash.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix index 2b01c9d26c41e..d22f9dfa3199b 100644 --- a/nixos/modules/programs/bash/bash.nix +++ b/nixos/modules/programs/bash/bash.nix @@ -98,7 +98,12 @@ in if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then PROMPT_COLOR="1;31m" let $UID && PROMPT_COLOR="1;32m" - PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] " + if [ -n "$INSIDE_EMACS" ]; then + # Emacs term mode doesn't support xterm title escape sequence (\e]0;) + PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " + else + PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] " + fi if test "$TERM" = "xterm"; then PS1="\[\033]2;\h:\u:\w\007\]$PS1" fi |