powerlevel10k
powerlevel10k copied to clipboard
Add screen session as optional prompt list element
I would love an option to show the current screen session (the middle of a dot delimited string, unless blank) in my prompt.
See p10k help segment.
Add this to ~/.p10k.zsh:
function prompt_my_screen_session() {
if [[ -n $STY ]]; then
p10k segment -b yellow -f red -i 's' -t "${${STY#*.}%.*}"
fi
}
Then add my_screen_session to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS.
Change the values of -b, -f and -i as you like. See docs in p10k help segment.