https://fedoraproject.org/wiki/Changes/Color_Bash_Prompt
== Summary == Introduce a default colored prompt for Fedora's default shell bash.
== Owner ==
* Name: [[User:Petersen| Jens Petersen]]
* Email: petersen@redhat.com
== 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.
[https://petersen.fedorapeople.org/color-bash-prompt.png screenshot of color bash prompt in gnome-terminal]
== Feedback == Initial [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/... 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). ** like the old default prompt, no external commands or processes will be run by PS1 by default
* Other developers: bash and/or setup package maintainers to be consulted on the preferred implementation file location
* Release engineering: [https://pagure.io/releng/issues #Releng issue number]
* 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/ ([https://copr-dist-git.fedorainfracloud.org/cgit/petersen/bash-color-prompt/b... 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 == [https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition... 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.
Dne 05. 07. 23 v 11:25 Aoife Moloney napsal(a):
https://fedoraproject.org/wiki/Changes/Color_Bash_Prompt
== Summary == Introduce a default colored prompt for Fedora's default shell bash.
== Owner ==
Name: [[User:Petersen| Jens Petersen]]
Email: petersen@redhat.com
== 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.
[https://petersen.fedorapeople.org/color-bash-prompt.png screenshot of color bash prompt in gnome-terminal]
== Feedback == Initial [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/... devel list discussion thread]
There seems to be a general desire to have a colored prompt like other popular distros, which commonly use green
Shouldn't blue be the default for Fedora?
And I think that dark as well as light color schemes should be considered. IOW I appreciate the screenshot attached above, but could you also attach one with the light scheme? Thx a lot.
Vít
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). ** like the old default prompt, no external commands or processes will be run by PS1 by default
- Other developers: bash and/or setup package maintainers to be
consulted on the preferred implementation file location
Release engineering: [https://pagure.io/releng/issues #Releng issue number]
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/ ([https://copr-dist-git.fedorainfracloud.org/cgit/petersen/bash-color-prompt/b... 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 == [https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition... 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.
On Fri, Jul 07, 2023 at 01:38:08PM +0200, Vít Ondruch wrote:
There seems to be a general desire to have a colored prompt like other popular distros, which commonly use green
Shouldn't blue be the default for Fedora?
And I think that dark as well as light color schemes should be considered.
I thought we should be using ANSI_COLOR from /etc/os-release. Which is blue on Fedora.
Once upon a time, Vít Ondruch vondruch@redhat.com said:
Shouldn't blue be the default for Fedora?
Blue is probably a bad idea in a prompt, as the human eye doesn't perceive blue as strongly as green. The prompt isn't about art/style, it's purely about functionality.
I agree that blue is not good. It was impossible to read the welcome messages during boot and startup. The cyan/teal is much better.
I typically use amber on black but sometimes use green on black so I'm not sure that green would help those who also use green font color. For me, on a black background, #54FFFF works really well for both. Not so well on light backgrounds though.
I actually copy-paste the Debian prompt since Debian Jessie on my systems. Even though it uses blue-green colors, I can see it very well on both white and black background.
I think it would be nicer if we played around with several options and have the user have a simple way of choosing. There are many variants, some using git info, some using exit codes and so...
On 7. 7. 2023 14:56, Chris Adams wrote:
Once upon a time, Vít Ondruch vondruch@redhat.com said:
Shouldn't blue be the default for Fedora?
Blue is probably a bad idea in a prompt, as the human eye doesn't perceive blue as strongly as green. The prompt isn't about art/style, it's purely about functionality.
On Fri, Jul 7, 2023 at 9:36 PM Marián Konček mkoncek@redhat.com wrote:
I actually copy-paste the Debian prompt since Debian Jessie on my systems. Even though it uses blue-green colors, I can see it very well on both white and black background.
Okay
I think it would be nicer if we played around with several options and have the user have a simple way of choosing.
They *can* set PROMPT_COLOR to change coloring immediately. But it would be nice to have a configuration tool/UI some day.
There are many variants, some using git info, some using exit codes and so...
Exit code is already handled in the current implementation. I would like to make it more extensible in the future...
But I made a criteria that this simple MVP should not use PROMPT_COMMAND nor should the default PS1 cause *any* external process to run by default. So anyway this Change is not setting the bar very high, by design: there are certainly lots of more powerful solutions around like powerline or starship etc, and this Change is not competing with them. :-) The hope is that a simple conservative solution like this would be broadly acceptable as a desktop default.
Thanks, Jens
On Fri, Jul 7, 2023 at 7:38 PM Vít Ondruch vondruch@redhat.com wrote:
Dne 05. 07. 23 v 11:25 Aoife Moloney napsal(a):
:
There seems to be a general desire to have a colored prompt like other
popular distros, which commonly use green
Shouldn't blue be the default for Fedora?
(In some palettes the visibility of cyan text on white background is really poor and similarly blue text is often hard to make out on black background.)
We could try PROMPT_COLOR='46' which would give us a prompt with cyan background. Background prompt color actually achieves better contrast and stands out more I feel:
https://petersen.fedorapeople.org/color-bash-prompt-cyan-dark.png https://petersen.fedorapeople.org/color-bash-prompt-cyan-light.png
It has the advantage of not looking like colored text output by some commands: e.g. dnf may print packages in green. I personally use a prompt background color for good contrast.
And I think that dark as well as light color schemes should be
considered. IOW I appreciate the screenshot attached above, but could you also attach one with the light scheme? Thx a lot.
Okay, I have added a link to a light gnome-terminal screenshot too on the page. https://petersen.fedorapeople.org/color-bash-prompt-light.png
Jens
Sorry if this comes through twice. Apparently thunderbird's "Reply to list" thought I meant to send it to devel-announce, not devel.
On 7/5/23 05:25, Aoife Moloney wrote:
== Feedback == Initial [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/...
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.
So, a personal anecdote, but to provide some food for thought in favor if this:
I know it's ridiculous, but early in my playing with linux history, I was very turned off by Fedora for _precisely_ the fact that the prompt color default wasn't something more along the lines of what other distros did at the time. (These were back in the late single digit/early teens Fedora days). Any time I tried to stick with Fedora, this was always something that eventually made me want to switch back to something else.
Nowadays I powerline and move on, but some food for thought. It just didn't make Fedora feel "cool" or "modern". No matter how silly that thought actually was.
Thanks for the replies so far.
Unfortunately there is no easy way to detect dark or light terminals, to my knowledge at least. Green seems the most friendly color across different palettes and terminals. Though these days modern terminals tend to default to dark (most Fedora editions' default terminals are dark by default I think).
https://copr-dist-git.fedorainfracloud.org/cgit/petersen/bash-color-prompt/b... lists various examples of how users can customize the color: eg PROMPT_COLOR='33' (for yellow/brown).
On 7/9/23 22:20, Jens-Ulrik Petersen wrote:
Unfortunately there is no easy way to detect dark or light terminals, to my knowledge at least.
You can use the xterm OSC 11;? sequence to request the text background color. Emacs uses this to select light or dark theming.
If you are looking for other ideas, I embed loads of useful info in my prompt:
time, so you can roughly measure the time between commands, CPU architecture, how far ahead or behind you are in a git repo.
But this gets a +1 from me regardless of the result, colors are good if the terminal supports it.
What I did with the i3 Spin was to ask to the Design team for something that fits Fedora's color palette. I think for this you could do the same.
Br,
Hi,
Aoife Moloney amoloney@redhat.com writes:
https://fedoraproject.org/wiki/Changes/Color_Bash_Prompt
== Summary == Introduce a default colored prompt for Fedora's default shell bash.
== Owner ==
Name: [[User:Petersen| Jens Petersen]]
Email: petersen@redhat.com
== 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.
[https://petersen.fedorapeople.org/color-bash-prompt.png screenshot of color bash prompt in gnome-terminal]
I am overall in favor of this change, thanks for working on this Jens and for keeping it simple!
I like the simple look, but I would suggest to add a either spaces in front and after the exit code or braces around it or something else visually distinctive from the rest of the prompt. At the moment the exit code looks like something that got crammed into the prompt by accident.
Cheers,
Dan
On Sat, Jul 15, 2023 at 05:22:15PM +0200, Dan Čermák wrote:
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.
[https://petersen.fedorapeople.org/color-bash-prompt.png screenshot of color bash prompt in gnome-terminal]
I am overall in favor of this change, thanks for working on this Jens and for keeping it simple!
Me too!
On Sat, Jul 15, 2023 at 3:04 PM Matthew Miller mattdm@fedoraproject.org wrote:
On Sat, Jul 15, 2023 at 05:22:15PM +0200, Dan Čermák wrote:
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.
[https://petersen.fedorapeople.org/color-bash-prompt.png screenshot of color bash prompt in gnome-terminal]
I am overall in favor of this change, thanks for working on this Jens and for keeping it simple!
Me too!
I have a couple of suggestions:
* username and hostname be slightly different colors * wrap the return code in brackets
This is what I have for my fish prompt, as an example: https://ngompa.fedorapeople.org/color-fish-prompt.png
Am 15.07.2023 um 21:03 schrieb Matthew Miller mattdm@fedoraproject.org:
On Sat, Jul 15, 2023 at 05:22:15PM +0200, Dan Čermák wrote:
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.
[https://petersen.fedorapeople.org/color-bash-prompt.png screenshot of color bash prompt in gnome-terminal]
I am overall in favor of this change, thanks for working on this Jens and for keeping it simple!
Me too!
And me too. :-)
And it would be nice to get some color issues fixed in one step, e.g. light yellow warning and error messages a white background. Really ‚fun' for your eyesight
-- Peter Boy https://fedoraproject.org/wiki/User:Pboy PBoy@fedoraproject.org
Timezone: CET (UTC+1) / CEST /UTC+2)
Fedora Server Edition Working Group member Fedora Docs team contributor and board member Java developer and enthusiast