Color the default root shell prompt red and gold.

This commit is contained in:
Jonas 'Sortie' Termansen 2023-02-13 00:01:07 +01:00
parent 426ee920fb
commit 4d8cf6514e
1 changed files with 3 additions and 1 deletions

View File

@ -2024,7 +2024,9 @@ void read_command_interactive(struct sh_read_command* sh_read_command)
edit_state.complete_context = NULL;
edit_state.complete = do_complete;
const char* def_ps1 = "\\033[;1;32m\\u@\\H \\033[1;34m\\w \\$\\033[m ";
const char* def_ps1 = !getuid() ?
"\\033[;1;31m\\u\033[1;33m@\\H \\033[1;34m\\w \\033[1;31m\\$\\033[m " :
"\\033[;1;32m\\u@\\H \\033[1;34m\\w \\$\\033[m ";
const char* def_ps2 = "> ";
edit_state.ps1 = eval_ps(getenv_safe_def("PS1", def_ps1));
edit_state.ps2 = eval_ps(getenv_safe_def("PS2", def_ps2));