3
0
Fork 0
forked from mirrors/nixpkgs

nixos: configure bash prompt in Emacs' shell-mode, even if TERM=dumb

The idea that the interactive bash prompt isn't set in case of TERM=dumb
is intended to fix problems when other machines log remotely into a
NixOS installation via Tramp. A side-effect that change was, however,
that Emacs' shell-mode no longer had a correct prompt. I suppose the
presence of

  INSIDE_EMACS=24.5.2,comint

is a sufficiently unique indication that the current interactive shell
is running inside of an Emacs and that the prompt can thus be configured
safely.
This commit is contained in:
Peter Simons 2015-11-18 16:24:14 +01:00
parent f9670479e8
commit 833a597156

View file

@ -90,8 +90,9 @@ in
promptInit = mkOption {
default = ''
if test "$TERM" != "dumb"; then
# Provide a nice prompt.
# Provide a nice prompt if the terminal supports it.
if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then
echo "Set prompt!"
PROMPT_COLOR="1;31m"
let $UID && PROMPT_COLOR="1;32m"
PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "