Are CLASSES supported for custom prompt segments? #2734
Closed
aschleifer
started this conversation in
General
Replies: 1 comment
-
CLASSES aren't supported for all segments out of the box. You can either use states (there is an example in function prompt_my_pwd() {
local content=$PWD
case $content/ in
~/*)
# Orange background if the current directory is under $HOME.
local bg=202
;;
*)
# Otherwise blue background.
local bg=27
;;
esac
p10k segment -b $bg -t "${content//\%/%%}"
} It's almost always easier to format the content of your custom prompt segments directly within the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a custom prompt segment in my p10k configuration and would like to use CLASSES similar to the
aws
orkubecontext
segment in order to use different colors based on the output of the segment.I have used
typeset -g POWERLEVEL9K_<MY_SEGMENT_NAME>_CLASSES=(...)
andtypeset -g POWERLEVEL9K_<MY_SEGMENT_NAME>_<MY_CLASS_NAME>_BACKGROUND=202
but I don't see any change in the behavior.Am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions