#1026379 skel.bashrc: please add foot to the color_prompt=yes check

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Andrea Pappacoda
Date:
2024-09-09 10:27:01 UTC
Severity:
normal
Tags:
#1026379#5
Date:
2022-12-19 09:53:41 UTC
From:
To:
Hi, skel.bashrc (installed as /etc/skel/.bashrc) currently sets
color_prompt=yes only if the TERM environment variable is either xterm-color or
ends with -256color. Please consider adding "foot*" to the check, as it does
support color too. You can find an explanation of foot's TERM handling in the
foot(1) manpage, also available at
<https://manpages.debian.org/testing/foot/foot.1#TERMINFO>.

I've attached a patch for your convenience.

Thanks for maintaining bash!

#1026379#10
Date:
2023-09-08 14:02:04 UTC
From:
To:
The problem with checking $TERM is you end up having to add every new
terminal type that is capable. In addition to foot, I know of kitty,
alacritty, wezterm, and there are likely more.

The comments around this section of skel.bashrc are unclear, talking
about setting a "fancy prompt (non-color)" then setting color_prompt=yes.

Given this, I propose to use a color prompt on any terminal that is
capable of it, with the uncomment override back to a plain prompt. Using
tput for detection basically means having ncurses-bin as a Recommends,
so we may want a better way of doing this detection.

Patch attached.

#1026379#15
Date:
2024-08-19 01:37:36 UTC
From:
To:
In addition to the color check, capable terminals should also be added
to the title set check, eg:

@@ -65,7 +65,7 @@

  # If this is an xterm set the title to user@host:dir
  case "$TERM" in
-xterm*|rxvt*)
+xterm*|rxvt*|foot)
      PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
      ;;
  *)

#1026379#20
Date:
2024-09-05 13:02:27 UTC
From:
To:
It would be a great idea to enable color and configure the title regardless
of the terminal used.

#1026379#25
Date:
2024-09-09 10:26:05 UTC
From:
To:
Surely Debian already does this for terminals that properly implement the
standard methods of declaring what colors they support.

eg if "tput setaf" and the like are working properly in foot then debian
will already enable colour support?.

 if it's not working, the bug should be against foot to implement those
properly.

There's no benefit to debian duplicating termcap/terminfo by endlessly
hardcoding more and more $TERM variants... am i missing something?