Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profile.d: prepend purple hexagon to PS1 rather than overwriting it #1517

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juhp
Copy link
Contributor

@juhp juhp commented Jul 7, 2024

Importantly this means the traditional Red Hat style prompt is not forced onto all other OS toolboxes as well.

juhp added a commit to juhp/toolbox that referenced this pull request Jul 7, 2024
This also avoids the need to have separate definitions for bash and zsh

More importantly it means the traditional Red Hat style bash prompt is
not forced onto all other OS toolboxes too.

containers#1517

Signed-off-by: Jens Petersen <petersen@redhat.com>
juhp added a commit to juhp/toolbox that referenced this pull request Jul 7, 2024
More importantly it means the traditional Red Hat style prompt is
not forced onto all other OS toolboxes too.

A space is added after the hexagon since vte tends to render it too  big
at least with google-noto-color-emoji-fonts.

containers#1517

Signed-off-by: Jens Petersen <petersen@redhat.com>
Importantly this means the traditional Red Hat style prompt is
not forced onto all other OS toolboxes too.

A space is added after the hexagon since vte tends to render it too big
at least with google-noto-color-emoji-fonts.

containers#1517

Signed-off-by: Jens Petersen <petersen@redhat.com>
@juhp
Copy link
Contributor Author

juhp commented Jul 7, 2024

I tested this locally in a VM and it works for me both with bash and zsh in fedora-toolbox:41
and ubuntu-toolbox:24.04

Copy link

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/6426b391ccd6403abb615593eb988e79

✔️ unit-test SUCCESS in 6m 34s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 29s
✔️ unit-test-restricted SUCCESS in 5m 34s
✔️ system-test-fedora-rawhide SUCCESS in 37m 44s
✔️ system-test-fedora-40 SUCCESS in 37m 05s
✔️ system-test-fedora-39 SUCCESS in 38m 06s
✔️ system-test-fedora-38 SUCCESS in 37m 11s

@glemco
Copy link

glemco commented Sep 11, 2024

This doesn't work if one overrides the PS1 in a user file (e.g. bashrc), as those are sourced after the ones in /etc/profile.d and would wipe the PS1 change introduced here.
A more robust way could be to override the PROMPT_COMMAND (#1357 (comment)), although I'm not fully sure about the implications on shells not supporting it as an array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants