fix: write the terminal title only when stderr is a terminal #4

Merged
varl merged 1 commit from runa/claudia:fix/title-only-on-tty into main 2026-10-12 13:29:29 +02:00
Collaborator

claudia prompt under a systemd unit or a pipe wrote the OSC title sequence to stderr, so a caller reading stderr back as the error got \e]0;claudia: default\a glued to the front of the first line.

Verified with systemd-run --user --pipe ... exec -- true: the current binary emits the escape, the patched one does not. Interactive launches are unchanged.

Found while moving runa's IRC and loop runs from claude -p to claudia prompt; headless prompt, --session-id/--resume passthrough and memory preload already work as-is.

`claudia prompt` under a systemd unit or a pipe wrote the OSC title sequence to stderr, so a caller reading stderr back as the error got `\e]0;claudia: default\a` glued to the front of the first line. Verified with `systemd-run --user --pipe ... exec -- true`: the current binary emits the escape, the patched one does not. Interactive launches are unchanged. Found while moving runa's IRC and loop runs from `claude -p` to `claudia prompt`; headless prompt, `--session-id`/`--resume` passthrough and memory preload already work as-is.
fix: write the terminal title only when stderr is a terminal
Some checks failed
ci/woodpecker/push/build Pipeline was canceled
e0d6b1a1d9
`claudia prompt` under a systemd unit or a pipe wrote the OSC title
sequence to stderr anyway, so a caller reading stderr back as the
error got `\e]0;claudia: default\a` glued to the front of the first
line. The sequence means nothing without a terminal; skip it there.
varl merged commit e0d6b1a1d9 into main 2026-10-12 13:29:29 +02:00
varl deleted branch fix/title-only-on-tty 2026-10-12 13:29:35 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
varl/claudia!4
No description provided.