Skip to content

pi: accept the input box when no status row sits under the bottom border #445

Open

Description

@viniciosrab

What happened, and what did you expect?

Collie finds pi's input box only when at least one status row sits under the editor's bottom border. If the bottom border is the last non-blank row of the pane, Collie does not recognise the input box, and a message sent from the phone stops with "the message didn't reach the input box".

pi does not need a footer. An extension can replace it with ctx.ui.setFooter(...) and render nothing, for example to show the status line somewhere else. With an empty footer, the editor is the last thing on screen:

────────────────────────────────────────
❯ hello
────────────────────────────────────────

I expected Collie to find this input box, because the top border, the ❯ row and the bottom border are all present.

Where it fails (1.21.3, built web bundle): the composer reader first trims blank rows at the bottom, then walks up over status rows (at most 4). When it finds none, it returns null before it looks at the bottom border:

let n = t;
for (; n > 0 && t - n < B$ && q$(e[n - 1]); ) n--;
if (n === t || n === 0 || !J$(e.slice(n, t))) return null;

A status row also has to be non-blank after trimEnd, must not start with a space, ❯ or a box character, and needs a foreground colour. So a blank or space-only row does not count either.

Workaround I use now: the footer draws one dim U+2800 (braille blank). It looks empty, but Collie counts it as text. It works, but it costs a screen row and depends on how the reader is written.

Proposal: accept zero status rows when the last non-blank row is a full-width bottom border (/^─{8,}$/) that pairs with a matching top border above it. The pairing and layout checks after that point already reject other boxes, so the status rows are not needed to avoid false matches. statusStart === end would mean "no status line", and the phone status strip would stay empty.

If the status row is there on purpose, for example to tell pi's editor apart from another harness's box, a note in the docs would help extension authors who change pi's footer.

Environment

  • Collie 1.21.3
  • pi 1.2.0, footer replaced by an extension (empty while a side column is open)
  • herdr, Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: harnessPer-agent adapters and send guards (claude/codex/pi/omp)bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions