From Fedora Project Wiki
(Undo revision 694776 by Praiskup (talk))
Tag: Undo
 
(25 intermediate revisions by 5 users not shown)
Line 3: Line 3:
= Color Bash Prompt =
= Color Bash Prompt =


{{Change_Proposal_Banner}}


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


== Owner ==
== Owner ==
Line 22: Line 21:


== Current status ==
== Current status ==
[[Category:ChangePageIncomplete]]
[[Category:ChangeAcceptedF39]]
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
Line 40: Line 39:
ON_QA -> change is fully code complete
ON_QA -> change is fully code complete
-->
-->
* [<will be assigned by the Wrangler> devel thread]
* [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/GP5T6Y6KCP2RVENYZ6UTV6O4A4JCDKKD/ devel thread]
* FESCo issue: <will be assigned by the Wrangler>
* FESCo issue: https://pagure.io/fesco/issue/3047
* Tracker bug: <will be assigned by the Wrangler>
* Tracker bug: [https://bugzilla.redhat.com/show_bug.cgi?id=2233267 #2233267]
* Release notes tracker: <will be assigned by the Wrangler>
* Release notes tracker: [https://pagure.io/fedora-docs/release-notes/issue/1004 #1004]


== Detailed Description ==
== Detailed Description ==
For a long time the Fedora default shell prompt has been monochrome,
For a long time the Fedora default shell prompt has been monochrome,
which makes it difficult to find shell prompt commands between command outputs when scrolling through terminal shell output.
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.
This Change introduces a simple default colored shell prompt, which users can also easily theme themselves.


[https://petersen.fedorapeople.org/color-bash-prompt.png screenshot of color bash prompt in gnome-terminal]
[https://petersen.fedorapeople.org/color-bash-prompt.png Screenshot of color bash prompt in dark gnome-terminal] &
[https://petersen.fedorapeople.org/color-bash-prompt-light.png Screenshot of color bash prompt in light gnome-terminal]


== Feedback ==
== Feedback ==
Initial [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/B5AJS3FIIPMF3KNWM7HRUNI7ISA2AKBR/#B5AJS3FIIPMF3KNWM7HRUNI7ISA2AKBR devel list discussion thread]
Initial [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/B5AJS3FIIPMF3KNWM7HRUNI7ISA2AKBR/#B5AJS3FIIPMF3KNWM7HRUNI7ISA2AKBR devel list discussion thread]


There seems to be a desire to have a colored prompt like other popular distros, which tend to use green commonly, 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 any color introduced.
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.


<!-- Summarize the feedback from the community and address why you chose not to accept proposed alternatives. This section is optional for all change proposals but is strongly suggested. Incorporating feedback here as it is raised gives FESCo a clearer view of your proposal and leaves a good record for the future. If you get no feedback, that is useful to note in this section as well. For innovative or possibly controversial ideas, consider collecting feedback before you file the change proposal. -->
<!-- Summarize the feedback from the community and address why you chose not to accept proposed alternatives. This section is optional for all change proposals but is strongly suggested. Incorporating feedback here as it is raised gives FESCo a clearer view of your proposal and leaves a good record for the future. If you get no feedback, that is useful to note in this section as well. For innovative or possibly controversial ideas, consider collecting feedback before you file the change proposal. -->
Line 65: Line 65:
* Proposal owners:
* Proposal owners:
** update the default bash PS1 to a simple essentially monochromatic prompt (restricted to interactive color terminals).
** 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` [[https://bugzilla.redhat.com/show_bug.cgi?id=2226663 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 [[https://pagure.io/fedora-comps/pull-request/874 PR]]


* Other developers: bash and setup package maintainers to be consulted on the preferred implementation file location
* Other developers:
<!-- was: bash and/or setup package maintainers to be consulted on the preferred implementation file location-->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- What work do other developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
<!-- What work do other developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
Line 93: Line 97:
* install Fedora and test the new PS1 prompt in various terminals and scenarios
* 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
** desktop default terminals should be expected to render the new prompt well
* try customizing the prompt theme by setting `PROMPT_COLOR='1;33', etc
* try customizing the prompt theme by setting for example `PROMPT_COLOR='1;33'` (bright/bold yellow), etc
<!-- This does not need to be a full-fledged document. Describe the dimensions of tests that this change implementation is expected to pass when it is done.  If it needs to be tested with different hardware or software configurations, indicate them.  The more specific you can be, the better the community testing can be.  
<!-- This does not need to be a full-fledged document. Describe the dimensions of tests that this change implementation is expected to pass when it is done.  If it needs to be tested with different hardware or software configurations, indicate them.  The more specific you can be, the better the community testing can be.  


Line 108: Line 112:
-->
-->


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


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->


== User Experience ==
== 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 customize the prompt coloring in real-time as they desire.
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.


<!-- If this change proposal is noticeable by users, how will their experiences change as a result?
<!-- If this change proposal is noticeable by users, how will their experiences change as a result?
Line 139: Line 142:


== Documentation ==
== Documentation ==
[https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters ANSI color attributes] (Wikipedia)
<!-- Is there upstream documentation on this change, or notes you have written yourself?  Link to that material here so other interested developers can get involved. -->
<!-- Is there upstream documentation on this change, or notes you have written yourself?  Link to that material here so other interested developers can get involved. -->


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
N/A (not a System Wide Change)


== Release Notes ==
== Release Notes ==

Latest revision as of 10:38, 16 November 2023


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.