Package: bash
Version: 5.1-6
Severity: wishlist
Tags: patch

Hi,

Some terminals (notably kitty) have the same features/etc
as say xterm-256color. Instead of extending the matching
for each terminal type, we should use the terminfo database
and query for 256 colors?

See the attached patch.


Cheers

    Elrond
--- debian/skel.bashrc
+++ debian/skel.bashrc
@@ -36,9 +36,10 @@
 fi
 
 # set a fancy prompt (non-color, unless we know we "want" color)
-case "$TERM" in
-    xterm-color|*-256color) color_prompt=yes;;
-esac
+if [ -x /usr/bin/tput ] && [ "$(/usr/bin/tput colors || echo 0)" -ge 256 ]
+then
+    color_prompt=yes
+fi
 
 # uncomment for a colored prompt, if the terminal has the capability; turned
 # off by default to not distract the user: the focus in a terminal window

Reply via email to