mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 13:41:26 +00:00
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.
This commit is contained in:
parent
f86bbb218c
commit
844200a06f
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue