-
Notifications
You must be signed in to change notification settings - Fork 1
Home
NSPC911 edited this page Jun 15, 2026
·
3 revisions
Drop-in subclasses of Textual's built-in terminal drivers with two extra capabilities:
| Capability | Summary |
|---|---|
lock_stdin |
Pause the driver's stdin thread and silence terminal events, letting you run terminal queries or subprocesses without interference |
register_event_handler |
Bind a pattern against raw stdin; when it matches, a Message is posted into Textual's event system |
A higher-level DNDApp base class builds on these to implement the full kitty drag-and-drop protocol (drag-in and drag-out).
uv add textual-drivers
Or with pip:
pip install textual-drivers
import sys
from textual.app import App, ComposeResult
from textual.widgets import Label
from textual_drivers import DrivenApp
class MyApp(DrivenApp):
def compose(self) -> ComposeResult:
yield Label("Hello!")
MyApp().run()DrivenApp picks the right platform driver automatically. See Drivers for manual driver selection and mixin usage.
-
Drivers: driver classes,
DrivenApp, and using the mixin in your own driver - lock-stdin: exclusive stdin ownership for terminal queries and subprocesses
- register-event-handler: pattern-based raw stdin → Textual message routing
-
DnD: kitty drag-and-drop protocol via
DNDApp