Compare commits

..

No commits in common. "427044730dc1d5dcb7ccadd2cd92d4b4d9fa25dd" and "18f60085dadd2ff3d76781917a30fd12fa279719" have entirely different histories.

View File

@ -78,24 +78,17 @@ in rec {
# We put PROMPT in initExtra instead of localVariables.PROMPT because nix puts the string in double quotes, whereas we want single quotes for the command to run each time
initExtra =
''
get_stuff_in_nix() {
printf "%s" $PATH | tr ':' '\n' | grep '/nix/store' \
| sed -Ee 's|/nix/store/[0-9a-z]*-(.*)/.*|\1|g' \
| sed -Ee 's|-[0-9]+(\.[0-9]+)+||g' \
| tr '\n' ' '
}
export PROMPT='$(
BG=$PROMPT_COLOR
FG=0
NIX_CONTENT="$(get_stuff_in_nix)"
if [ ! -z "$NIX_BUILD_CORES" -o ! -z "$NIX_CONTENT" ] ; then
BG=91
if [ ! -z $NIX_BUILD_CORES ] ; then
BG=56
FG=15
fi
echo -en "%{\033[0m\033[38;5;''${FG}m\033[48;5;''${BG}m%} ";
echo -n "["
${unambig-path}/bin/unambig-path
echo -en "] $NIX_CONTENT%T ";
echo -en "] %T ";
echo -en "%{\033[0m\033[38:5:''${BG}m%}"
echo -en "%{\033[0m%} ";
)'