From Fedora Project Wiki

Revision as of 23:21, 28 September 2023 by Adamwill (talk | contribs) (update release note tracker)


Color Bash Prompt

Summary

Introduce a default colored prompt for Fedora's default shell bash.

Owner


Current status

Detailed Description

For a long time the Fedora default shell prompt has been monochrome, which makes it difficult to find shell prompt commands between long command outputs when scrolling through terminal shell output. This Change introduces a simple default colored shell prompt, which users can also easily theme themselves.

Screenshot of color bash prompt in dark gnome-terminal & Screenshot of color bash prompt in light gnome-terminal

Feedback

Initial devel list discussion thread

There seems to be a general desire to have a colored prompt like other popular distros, which commonly use green etc, though some concerns were raised about colorblind users. However given that the original prompt was black & white, and the new one while colored will still be essentially monochromatic, it should be less of a problem and users will easily be able to turn off or change any color introduced.


Benefit to Fedora

Fedora will have a more modern and distinct default shell prompt.

Scope

  • Proposal owners:
    • update the default bash PS1 to a simple essentially monochromatic prompt (restricted to interactive color terminals).
      • for this now this will be done as a separate package bash-color-prompt [review done]
    • like the old default prompt, no external commands or processes will be run by PS1 by default
    • add bash-color-prompt to comps so that it will be installed by default in most editions [PR]
  • Other developers:
  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Community Initiatives:

Upgrade/compatibility impact

No impact for rpm editions, ostree editions may gain the default color prompt if they include its package.


How To Test

  • install Fedora and test the new PS1 prompt in various terminals and scenarios
    • desktop default terminals should be expected to render the new prompt well
  • try customizing the prompt theme by setting for example PROMPT_COLOR='1;33' (bright/bold yellow), etc

A proof of concept can be tested today with https://copr.fedorainfracloud.org/coprs/petersen/bash-color-prompt/ (source git repo)


User Experience

Fedora users will now benefit from a clear self-colored shell prompt, which should make the separation between command outputs and shell prompts much clearer and they can also easily change the prompt coloring in real-time as they desire.


Dependencies

None


Contingency Plan

  • Contingency mechanism: Change owner will revert PS1 back to monochrome prompt
  • Contingency deadline: Beta freeze
  • Blocks release? Yes

Documentation

ANSI color attributes (Wikipedia)


Release Notes

The default shell prompt is now in a distinct color for increased clarity and the theme can be customized.