Metadata-Version: 2.3
Name: textual-drivers
Version: 0.1.3
Summary: Drop-in Textual drivers with lock_stdin, register_event_handler, and kitty DnD support
Author: NSPC911
Author-email: NSPC911 <87571998+NSPC911@users.noreply.github.com>
Requires-Dist: textual>=8.2.7
Requires-Dist: wrapt>=2.2.1
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# textual-drivers

Drop-in subclasses of Textual's built-in terminal drivers with two extra capabilities:

- **`lock_stdin`** — pause the driver's stdin thread and silence terminal events so you can 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).

## Installation

```
uv add textual-drivers
```

## Quick start

```python
from textual_drivers import DrivenApp

class MyApp(DrivenApp):
    ...

MyApp().run()
```

`DrivenApp` picks the right platform driver automatically.

## Documentation

Full docs are on the [wiki](../../wiki):

- [Drivers](../../wiki/drivers) — driver classes, `DrivenApp`, and mixin usage
- [lock_stdin](../../wiki/lock-stdin) — exclusive stdin ownership for terminal queries and subprocesses
- [register_event_handler](../../wiki/register-event-handler) — pattern-based raw stdin → Textual message routing
- [DnD](../../wiki/dnd) — kitty drag-and-drop protocol via `DNDApp`

The `docs/` folder in this repo mirrors the wiki and can be pushed to it with:

```
./sync-wiki.sh
```
