MultiLine = false is the default and preserves the existing single-row behavior:
the control measures to a single row (Height = 1) and to the current content width (focused context), while allowing clipping when the available width is smaller
render clears the entire bar row using CommandBarStyle.Resolve(theme).BarStyle (chrome must not “inherit” background/attributes from content behind it)
MultiLine = true allows wrapped layout:
the control may measure to multiple rows when the available width is bounded
command entries wrap as atomic units; if an entry does not fit in the remaining space on the current row, it starts on the next row
separators are not rendered at the start of a wrapped row
In both modes, when a key sequence prefix is active (TerminalApp.PendingCommandSequenceCount > 0), CommandBar renders the pending prefix + … before regular entries.
Command collection
The bar collects local commands from the focused visual chain and global commands from TerminalApp.
Commands are filtered by:
Presentation flags (default is CommandPresentation.CommandBar)
enabled/visible state (Command.IsVisibleFor(target), Command.CanExecuteFor(target))
de-duplication by Command.Id (local wins over global).
When a command sequence prefix is active, the bar can restrict displayed sequence commands to those matching the prefix.
Styling
CommandBarStyle controls:
bar background/foreground
keycap glyphs and styles
label style and disabled label style
separator text
Labels are rendered from Command.LabelMarkup via MarkupTextParser using the current theme markup styles.
Public API
Presentation : CommandPresentation
MultiLine : bool (default false)
Future ideas
Optional “More…” entry that opens a help/palette surface when there is insufficient space.
Optional grouping (local vs global) or ordering by importance/category.