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

Add optional prompt prefix if root #378

Closed
wants to merge 1 commit into from

Conversation

pmccarren
Copy link

I propose we add an optional prefix to the prompt if we are root. I find the extra visibility to be of value when working on remote boxes in production.

The proposed prefix is adding a red #.
e.g. # ❯

screenshot

We should default to hiding the prefix unless configured to do otherwise. This is accomplished by checking for the existence of the PURE_ROOT_HASH variable, which is by default not set.

@mafredri
Copy link
Collaborator

mafredri commented Feb 24, 2018

I don't think this is a common enough use case, and it wouldn't feel right to introduce yet another option just to have multiple indications of the same thing (there's already the white root).

You can easily achieve the same thing by setting the prompt symbol in your .zshrc:

# Being thorough here and closing the original %F{magenta} and not adding a %f at the end as this will be added by PS1
PURE_PROMPT_SYMBOL='%f%F{red}#%f %F{magenta}❯'

Does that work for you?

@mafredri
Copy link
Collaborator

mafredri commented Apr 18, 2018

This has been added to the readme: Prefix prompt when logged in as root. Even though this didn't turn out to be a good fit for Pure, we appreciate your contribution :).

@mafredri mafredri closed this Apr 18, 2018
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