mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2025-12-25 22:22:31 +01:00
add REMOTE_ROOT context
This commit is contained in:
parent
622130980c
commit
97615b63c4
1 changed files with 10 additions and 2 deletions
|
|
@ -1502,7 +1502,9 @@ prompt_context() {
|
|||
|
||||
local state
|
||||
if (( P9K_SSH )); then
|
||||
if [[ -n "$SUDO_COMMAND" ]]; then
|
||||
if [[ "$UID" -eq 0 ]]; then
|
||||
state="REMOTE_ROOT"
|
||||
elif [[ -n "$SUDO_COMMAND" ]]; then
|
||||
state="REMOTE_SUDO"
|
||||
else
|
||||
state="REMOTE"
|
||||
|
|
@ -1514,7 +1516,13 @@ prompt_context() {
|
|||
fi
|
||||
|
||||
local cond
|
||||
for state cond in $state '${${(%):-%#}:#\#}' ROOT '${${(%):-%#}:#\%}'; do
|
||||
local root
|
||||
if [[ $state = "REMOTE_ROOT" ]]; then
|
||||
root=$state
|
||||
else
|
||||
root="ROOT"
|
||||
fi
|
||||
for state cond in $state '${${(%):-%#}:#\#}' $root '${${(%):-%#}:#\%}'; do
|
||||
local text=$content
|
||||
if [[ -z $text ]]; then
|
||||
local var=_POWERLEVEL9K_CONTEXT_${state}_TEMPLATE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue