Bug 2239152
Summary: | Usability regression in the proposed colored bash prompt | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Thomas M Steenholdt <tmus> |
Component: | shell-color-prompt | Assignee: | Jens Petersen <petersen> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 39 | CC: | admiller, information, kasal, kdudka, petersen, svashisht |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | shell-color-prompt-0.2-1.fc37 shell-color-prompt-0.2-1.fc38 shell-color-prompt-0.2-1.el9 shell-color-prompt-0.4-1.fc39 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-11-20 00:50:57 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 2233267 |
Description
Thomas M Steenholdt
2023-09-15 14:18:07 UTC
Hello, this feature is not part of bash package nor is maintained by any current bash maintainer. Reassigning to shell-color-prompt. Regards Lukas Another thing, the proposal has changed the basic look of the prompt for normal users, but no change has been implemented for root (even as a colorless variant). Things should probably be aligned either way. You are right that the working dir format changed. I am not a fan of "information hiding": to me \W is too terse/ambiguous. So I would like to see the bash system default change to \w. I can open such an RFE and see. I certainly agree consistency does make sense. Not changing root was kind of intentional - though personally I would like to color root too. So of the original feedback was sceptical about color blindness etc, so I took a conservative minimal approach. I have made the exit code opt-in in rawhide yesterday and I am adding a PROMPT_DIR_COLOR envvar to allow changing the dir color easily. I will backport those soon to current releases too. Overall tighter integration with the main bash package would help here (and is still possible in the future I hope), but I also wanted to start with something that can be disabled/removed with just one command. Thanks for the good feedback. And sorry I didn't see this earlier, my bad :-( I pushed 0.2 to rawhide which tries to address a few more of your concerns. I wish there was an easy way to toggle \w and \W (if only bash supported ternary expansions: the only workaround around I know is to introduce another envvar for the directory expansion). I may do that in the future: I think it might also require a second envvar for the separator (space or colon) (short of an if statement with separate PS1's, which I would rather avoid so far). I would like to revisit root color later too. FEDORA-2023-3e862eb724 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-3e862eb724 FEDORA-2023-fb9fbe1bed has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-fb9fbe1bed FEDORA-2023-3e862eb724 has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-3e862eb724` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-3e862eb724 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-79d91fcab0 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-79d91fcab0 FEDORA-EPEL-2023-dc012e88bc has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-dc012e88bc FEDORA-2023-fb9fbe1bed has been pushed to the Fedora 38 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-fb9fbe1bed` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-fb9fbe1bed See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-EPEL-2023-dc012e88bc has been pushed to the Fedora EPEL 9 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-dc012e88bc See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-79d91fcab0 has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-79d91fcab0` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-79d91fcab0 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. The latest changes massively improves on the customizability of the default shell, which I believe is an improvement. I'm still not a big fan of the new "layout", however. But if given the possibility to tweak the ":" delimiter between hostname and path in addition to the other improvements, I can actually make it look just the way I like it (which I believe is more in line with previous Fedora prompts and makes it easier to distinguish the prompt from other terminal content), without changing the actual PS1 variable myself. # This is the new prompt, but with PROMPT_DELIMITER added as a way to customize the ":" part: PS1='${PROMPT_BRACKETS:+[}\[\e[${PROMPT_COLOR:-32}m\]\u@\h\[\e[0m\]${PROMPT_DELIMITER:-:}\[\e[${PROMPT_DIR_COLOR:-${PROMPT_COLOR:-32}}m\]\w${PROMPT_ERROR:+\[\e[0;31m\]${?#0}}\[\e[0m\]${PROMPT_BRACKETS:+]}\$ ' With this in place, "the perfect prompt" can be set with: PROMPT_BRACKETS=1 PROMPT_COLOR='1;32' PROMPT_DELIMITER=' ' PROMPT_DIR_COLOR='1;34' Sure, it's easier to just set the PS1 value the way I like it, but we're so close. :-) Thanks Thomas, glad you liked the improvements. I agree with you and I think we are thinking the same. :-) I basically also implemented your idea with a $PROMPT_SEPARATOR. Took me some days to get it right and together with $PROMPT_DIRECTORY for those that prefer '\W`. I replaced PROMPT_BRACKETS with PROMPT_START and PROMPT_END for further flexibility. Thanks for the great feedback and suggestions. Really helped to improve bash-color-prompt. Now your perfect prompt might look like this: ``` PROMPT_START='[' PROMPT_END=']' PROMPT_SEPARATOR=' ' PROMPT_DIRECTORY='\W' PROMPT_COLOR='1;32' PROMPT_DIR_COLOR='1;34' ``` (In reply to Jens Petersen from comment #15) > ``` > PROMPT_START='[' > PROMPT_END=']' > PROMPT_SEPARATOR=' ' > PROMPT_DIRECTORY='\W' > PROMPT_COLOR='1;32' > PROMPT_DIR_COLOR='1;34' > ``` or just: $ prompt_traditional '1;32' '1;34' That's pretty cool, and very useful for me. :-) FEDORA-2023-3e862eb724 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2023-2345dc7e62 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-2345dc7e62 FEDORA-2023-2345dc7e62 has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-2345dc7e62` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-2345dc7e62 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-79d91fcab0 has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2023-fb9fbe1bed has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-EPEL-2023-dc012e88bc has been pushed to the Fedora EPEL 9 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2023-2345dc7e62 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report. |