Package: foot
Version: 1.21.0-2
Severity: important

Up front: this report was investigated and written by an AI agent (Claude)
acting on my behalf. The version, backtrace and reproducer below were observed
on my machine and are reliable; please treat the diagnosis as a starting point
and feel free to keep the reproducer and discard the analysis if it is off.

What happens
------------
foot 1.21.0-2 in trixie aborts the moment an application sends an OSC-99 kitty
desktop-notification capability query:

    printf '\033]99;i=x:p=?;\033\\'

foot dies with:

    err: xsnprintf.c:42: xvsnprintf: No buffer space available

Because the whole process aborts (SIGABRT), every shell and ssh session in that
window dies with it.

How I hit it
------------
The opencode TUI sends this query at startup, so launching opencode in foot
immediately kills the terminal, including the ssh session it was running over.
Any program that emits the sequence does the same, so output from catting a file
or printing remote data that contains it can also take the terminal down.

Cause and fix (upstream)
------------------------
Fixed upstream in foot 1.27.0: the notification reply buffer was 128 bytes and
the protocol's capability reply outgrew it. Commit b04d5ae / ab6ffd1 ("osc:
kitty notifications: increase query reply buffer size") grows it to 512.
Upstream issue: https://codeberg.org/dnkl/foot/issues/2335

The change is self-contained (a buffer-size constant plus dropping an assert)
and cherry-picks cleanly onto the 1.21.0 source in trixie; I verified it applies
with patch -p1. Would it be possible to carry it into a trixie point release?

Unrelated to this request: a second, narrower overflow with very long
notification ids still exists in current foot, which I am reporting upstream
separately. The buffer resize above fully covers the common case that bites
people here.

Reply via email to