Open etircopyh opened 3 years ago
This would be great. It's something I have in my current prompt (home grown) and I just spent a while trying to figure out how to get it working in starship.
Edit: Managed to work around this in bash for now… Mileage may vary for other shells so it would still be great to have a starship solution.
[character]
success_symbol = '\$'
from https://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html
\$
: if the effective UID is 0, a #, otherwise a $
starship.toml
config in user modevi ~/.config/starship.toml
[character]
success_symbol = "[\\$](green bold)"
error_symbol = "[\\$](red bold)"
sudo -s
starship.toml
under the root# /home/root/.config/starship.toml
vi ~/.config/starship.toml
[character]
success_symbol = "[#](green bold)"
error_symbol = "[#](red bold)"
Bumping this, would be great to have[^1]
[character]
success_symbol = "[%](green)"
error_symbol = "[%](red)"
root_success_symbol = "[#](green)"
root_error_symbol = "[#](red)"
[^1]: on shells different than bash and for other operating systems as well!
Feature Request
Describe the solution you'd like
Would be nice to have this feature to reflect more clear difference of prompt that you're in. For example when user is root then set
#
symbol as character and when is not then something else. I don't think that there are needed any default values I guess it makes sense for this feature to be disabled by default and override current behavior by user's explicit choice.