zsh:p10k: Modify context segment format template

Display only `user` when not in a remote shell and `user@hostname` when
connected.

Display the content in bold when running with privileges (no SSH & SSH).
This commit is contained in:
2022-05-01 13:40:00 +02:00
parent 33f9a34895
commit a912530f6f

View File

@@ -850,12 +850,14 @@
# Default context color (no privileges, no SSH).
typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180
# Context format when running with privileges: bold user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m'
# Default context format (no privileges, no SSH): user.
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n'
# Context format when running with privileges: bold user.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n'
# Context format when in SSH without privileges: user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
# Default context format (no privileges, no SSH): user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_TEMPLATE='%n@%m'
# Context format when in SSH with privileges: bold user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_REMOTE_SUDO_TEMPLATE='%B%n@%m'
# Don't show context unless running with privileges or in SSH.
# Tip: Remove the next line to always show context.