Add two color for the X11 support, green (support) and yellow (no support, not
set in red, because it is not a critical warning). The bold cyan of the hostname
was to close to the green of the colon and the @, change it to blue.
If the current connection supports X (if we are in a X session or if we have
enabled X11 forwarding under ssh), the @ displayed in front of the hostname
is colored in blue (use LP_COLOR_X11 to change the color).
Without the patch my prompt is (on 3 lines):
[rousseau:~/Documents/sc/nfc/libnfc]
svn ‡
With the patch my prompt is (on 1 line only):
[rousseau:~/Documents/sc/nfc/libnfc] svn ‡
This is because expr(1) adds a new line at the end of the result.
Debian uses the file /etc/debian_chroot to give a name to a chroot.
The default /etc/bash.bashrc contains:
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
With the previous code I get an error before each prompt:
-bash: $/dev/fd/62: No such file or directory
Maybe the same code can't be used for both Darwnin and FreeBSD.
I reuse the code removed in 2a833475bc6661a59b5eecc4f8aa343f4bb1977b
Now that color definition utilities (_lp_ti_*) variables and functions
are "local" we do not fear to override someting defined by the user.
So just rename to shorter and cleaner names without the _lp_ prefix.
Move colors definitions inside _lp_source_config.
(The important part of the diff is that the beginning of the
_lp_source_config function is moving up).
Now use TermInfo feature detection instead of just distinguishing if
"$OS == FreeBSD". This will allow support for more terminal definitions.
Cleanup color variables (BLACK, WHITE, BLUE, BOLD...) once the config
file has been loaded as color variables are not used at runtime.
In eec94d1db8d2a87b10c1034429f44c00bffc1be8 (which is about the time
feature) it looks like 7f2ed35c414cbb5b34ea50ac8867fa58311ff4fb has
been reverted (probably a merge error). This patch reapplies it.