# server: strip terminal controls from hook decision prompts and labels \(\#93\) · lucenx/signaltty

[View on GitCafe](https://git.cafe/lucenx/signaltty/commit/e04c08d4515460264fec2837d045b6999f14d4b7)

Repository: [lucenx/signaltty](https://git.cafe/lucenx/signaltty)

Visibility: public

Requested revision: e04c08d4515460264fec2837d045b6999f14d4b7

Requested commit: e04c08d4515460264fec2837d045b6999f14d4b7

Commit: e04c08d4515460264fec2837d045b6999f14d4b7

Tree: a85ec8cce4c6e69bdd22762b0ffd474f9f0867e6

Author: Simone

Committer: GitHub

## Message

```
server: strip terminal controls from hook decision prompts and labels (#93)

* server: strip terminal controls from hook decision prompts and labels

Decision prompts and option labels from hook-event payloads were stored
verbatim and printed raw by `signaltty pane get`, so an escape sequence
in a hook payload could drive the reader's terminal (title, clipboard,
screen clear). Clean them like notification text before validation, and
refuse decision IDs with control characters since they are echoed back
to answer.

* server: strip terminal controls from hook lifecycle messages

The adapter's lifecycle message is copied from the hook payload (Claude
prompt/message, Codex prompt/tool_name/description, last_assistant_message
on Stop) and stored as the pane's last_message, which `signaltty attention
pending` prints. A notification usually rewrites it with sanitized text,
but not when the text is only controls (empty notification body) or the
hook passes an explicit empty `message` (no notification). Clean it like
other hook text right after classification, dropping it when empty.

---------

Co-authored-by: Lucenx9 <185146821+Lucenx9@users.noreply.github.com>
```

## Parents

- [fc1a517ddf2a2c50847d87cb31521562f2a0c10f](https://git.cafe/lucenx/signaltty/commit/fc1a517ddf2a2c50847d87cb31521562f2a0c10f?format=markdown)

[Source at this commit](https://git.cafe/lucenx/signaltty/tree/e04c08d4515460264fec2837d045b6999f14d4b7?format=markdown)
