Skip to content

statusBar add

Add a status bar item that runs a command, opens a panel, creates a new command, or opens a popup menu.

Terminal window
vsceasy statusBar add --name sync --text "$(sync) Sync" --bindTo command --command doSync

Flags

FlagTypeNotes
--nametextRequired. Item id.
--texttextRequired. Label (supports $(codicon) syntax).
--alignmentleft | rightSide of the status bar.
--prioritynumberHigher = further left within its side.
--bindTocommand | panel | create new command | menuWhat the item does on click.
--commandcommand idWhen --bindTo command.
--panelpanel idWhen --bindTo panel.
--newCommandTitletextWhen --bindTo "create new command".
--menumenu idWhen --bindTo menu.
--label / --kindMenu item details when binding to a popup menu.

Examples

Terminal window
# open a panel
vsceasy statusBar add --name dash --text "$(dashboard) Dashboard" --bindTo panel --panel dashboard
# run an existing command
vsceasy statusBar add --name fmt --text "$(wand) Format" --bindTo command --command format
# create the command at the same time
vsceasy statusBar add --name greet --text "Hello" --bindTo "create new command" --newCommandTitle "Say Hello"
src/statusBars/sync.ts
import { defineStatusBar } from '../shared/vsceasy';
export default defineStatusBar({
text: '$(sync) Sync',
alignment: 'left',
command: 'doSync',
});