# set_terminal_background

> **Function** in `deepagents_code`

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

Set the terminal's dynamic default background color with `OSC 11`.

This is cosmetic and intentionally best-effort. Terminals that don't
support `OSC 11` ignore it; `OSC 111` is emitted from `atexit` to restore
the default background when this call succeeds.

## Signature

```python
set_terminal_background(
    color: str,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `color` | `str` | Yes | Terminal color payload, usually a CSS-style hex color such as `#11121D`. |

## Returns

`bool`

`True` if the sequence was written.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0412009c5441bef8d75a427e1da8909e33ab5b56/libs/code/deepagents_code/terminal_escape.py#L237)