# stdout_driver_class

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_terminal_stderr/stdout_driver_class)

Return a Textual Unix driver class that renders through stdout.

Textual's `LinuxDriver` writes every frame to `sys.__stderr__`, while
`TerminalStderrGuard` points fd 2 at `/dev/null` — so under an active guard
the stock driver renders the whole TUI into the void. The returned subclass
aims driver output at `sys.__stdout__` instead, which the guard leaves
alone and which `_stderr_targets_stdout` has already proven is the same
terminal. Callers must not install the guard without also applying this.

Like the patches in `_textual_patches`, this reaches into private Textual
state and so refuses to guess when the ground shifts: it returns `None`
when stdout cannot carry the TUI or when the caller's own driver choice
must win, and the subclass raises rather than rendering blind if Textual
ever stops keeping its output stream in `_file`.

## Signature

```python
stdout_driver_class() -> type[Driver] | None
```

## Returns

`type[Driver] | None`

The driver class, or `None` when the caller should leave both the

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/_terminal_stderr.py#L27)