[go: up one dir, main page]

Skip to content

textual.system_commands

This module contains SystemCommands, a command palette command provider for Textual system commands.

This is a simple command provider that makes the most obvious application actions available via the command palette.

Note

The App base class installs this automatically.

SystemCommandsProvider

SystemCommandsProvider(screen, match_style=None)

Bases: Provider

A source of command palette commands that run app-wide tasks.

Used by default in App.COMMANDS.

Parameters:

Name Type Description Default

screen

Screen[Any]

A reference to the active screen.

required

discover async

discover()

Handle a request for the discovery commands for this provider.

Yields:

Type Description
Hits

Commands that can be discovered.

search async

search(query)

Handle a request to search for system commands that match the query.

Parameters:

Name Type Description Default

query

str

The user input to be matched.

required

Yields:

Type Description
Hits

Command hits for use in the command palette.