# resolve_terminal_mapping

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/configuration/theme_resolution/resolve_terminal_mapping)

Resolve `[ui.terminal_themes][TERM_PROGRAM]` to a registered theme.

Centralizes both the lookup and the misconfiguration warnings, which are
logged exactly once per call. Three callers now share that contract: the
managed and user TOML tiers and the UI.

## Signature

```python
resolve_terminal_mapping(
    ui: Mapping[str, object],
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `ui` | `Mapping[str, object]` | Yes | An `[ui]` table parsed from a managed or user TOML source. |

## Returns

`str | None`

Canonical registry key, or `None` when no valid mapping applies.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/configuration/theme_resolution.py#L62)