fish-shell/fish-shell — pull request #1351 by mdesantis (2014-03-21 16:48:59+00:00)
Title: Debian chroot environment in prompt

When you chroot in Debian, bash shows the chroot environment in fish the prompt:

```bash
# inside /etc/bash.bashrc

...

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

...
```

This is the effect:

```
(chroot_env)user@host:~#
```

It is useful when chrooting, since usually the hostname remains the same and thus you can't distinguish where you are.

My proposal has the same effect. I tested it and it works.

Feel free to discuss it, I made it on the fly.