commit 150ceb0e45a2e0c1738092cb73deffb80ff291fa
parent 2765a69bd3c65af9bd72a927cff065439401e612
Author: spacehobo <spacehobo@web>
Date: Sat, 16 May 2026 12:06:01 +0200
current eik version
Diffstat:
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/spacehobo.mdwn b/spacehobo.mdwn
@@ -1,17 +1,26 @@
# Just a Rum-Soaked Space Hobo with a Heart full of Love
-Hey, check out my neat `bash` prompt:
+Hey, check out my neat `bash` prompt, which I put in eik's `/etc/bash_completion.d/prompt.bash` so everyone gets it:
```{sh}
-GIT_PS1_SHOWCOLORHINTS='y'
+# Set XDG_SESSION_TYPE to "tty" if sudo/ssh are involved
+# and we aren't on a new enough system to support it.
+[ $((${#SSH_CONNECTION}+${#SUDO_USER})) = 0 ] || true ${XDG_SESSION_TYPE:=tty}
GIT_PS1_SHOWDIRTYSTATE='y'
GIT_PS1_SHOWSTASHSTATE='y'
GIT_PS1_SHOWUNTRACKEDFILES='y'
GIT_PS1_DESCRIBE_STYLE='contains'
GIT_PS1_SHOWUPSTREAM='auto'
-# Set XDG_SESSION_TYPE to "tty" if sudo/ssh are involved
-# and we aren't on a new enough system to support it.
-[ $((${#SSH_CONNECTION}+${#SUDO_USER})) = 0 ] || true ${XDG_SESSION_TYPE:=tty}
+
+if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+ # We have color support; assume it's compliant with Ecma-48
+ # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+ # a case would tend to support setf rather than setaf.)
+ GIT_PS1_SHOWCOLORHINTS='y'
+else
+ return
+fi
+
# We build the shell from right to left, starting with a
# $ or # that is either bold default, or blinking red
@@ -61,6 +70,6 @@ And if you are in a chroot with background processes looking at a git repo after
(1)[2](thechroot)user@hostname:~/src/therepo{main $%}$
-with coloured styling information on all the various parts.
+with coloured styling information on all the various parts. I'm tinkering with a branch to turn off colours but keep the dynamism if tput fails.
I just think it's neat!