Declares the start of a prompt section.
- This must eventually be followed by either another
promptfessional section
, orpromptfessional end
.
Failure to do so will result in the section not being displayed.
promptfessional section (OPTIONS) [SECTION_NAME]
Create a section:
promptfessional section my_section
promptfessional show my_component
promptfessional show my_other_component
promptfessional end
Query the current section color:
# Prints the current color.
# This is useful for components which need to reset to a default color.
promptfessional section --current-color
Option | Default | Description |
---|---|---|
--pattern |
%s |
Set the printf pattern for the section. This can be used to override the left and right padding. |
--delimiter |
`` | Set the delimiter between each component in the section. |
Sections can be individually colored with the color section.[SECTION_NAME]
.
For example, for a section called
foo
, its color will besection.foo
.promptfessional color --set section.foo --background=red
- If the
--pattern
ends with a space and the last component ends with a space, only one trailing space will be printed.