# write_osc

> **Function** in `deepagents_code`

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

Write an `OSC <command>;<payload>` sequence.

## Signature

```python
write_osc(
    command: str,
    payload: str = '',
    *,
    st: bool = False,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `command` | `str` | Yes | The numeric OSC command (e.g. ``"9;4"`` for taskbar progress). |
| `payload` | `str` | No | Optional semicolon-joined payload appended after the command. (default: `''`) |
| `st` | `bool` | No | When `True`, terminate with String Terminator (`ESC \`) instead of the default BEL (`\a`).  BEL matches the Windows Terminal docs and works on most terminals; VTE-derived terminals may prefer ST. (default: `False`) |

## Returns

`bool`

`True` if the sequence was written.

---

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