powerlevel10k icon indicating copy to clipboard operation
powerlevel10k copied to clipboard

Add screen session as optional prompt list element

Open mcandre opened this issue 3 years ago • 1 comments

I would love an option to show the current screen session (the middle of a dot delimited string, unless blank) in my prompt.

mcandre avatar Sep 14 '22 22:09 mcandre

See p10k help segment.

romkatv avatar Sep 14 '22 22:09 romkatv

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.

romkatv avatar Sep 16 '22 07:09 romkatv