Skip to content

A web tab's attach holds the pane's size, so typing and clicks land wrong in herdr's TUI #712

Closed

Description

@devswha

Summary

While a web UI tab holds a herdr terminal attach on a pane, herdr 0.9.3 keeps the pane at that attach's size and herdr's own TUI cannot resize it. In the real terminal the pane is then drawn at the wrong size, so typing and mouse clicks land in the wrong place. The input bytes themselves are not changed.

Seen on herdr-web-ui 0.4.4 with herdr 0.9.3. Reproduced in an isolated herdr session with a real TUI client.

What is not broken

With and without an attach, the program in the pane receives the same bytes from the TUI:

  • plain keys, arrows, function keys, mouse click, drag and wheel, focus events, bracketed paste
  • kitty keyboard protocol keys (Shift+Enter, Ctrl chords); the modes the TUI sets on its outer terminal do not change when an attach connects or ends
  • with the installed 0.4.4 server and a real browser, an idle web tab writes nothing into the pane on its own

What is broken

The pane's pty follows the attach's size, not the TUI's. Measured with the TUI's pane area at 73x29:

Case Result in the TUI
Attach is larger (145x39) The TUI shows only the top-left 73x29. A prompt on row 39 is off screen, typed text is not visible, and the cursor is drawn in the wrong cell.
Attach is smaller (50x15) The pane is drawn in the top-left corner. A click outside it loses its press, and its release arrives clamped to (50,15).
Attach has the same size, then the TUI window grows to 130x40 The pane stays 73x29 until the attach ends, then becomes 103x39. A click in the new area is clamped the same way.

On 0.4.4 the terminal lens takes the pane at its own size on every focus and lets go one second after blur (#660). So each switch between the browser and the terminal resizes the pane twice, and the TUI is wrong for about a second after switching back. A tab that stays in use, for example on another device, keeps the pane locked for as long as it is open.

Steps to reproduce

  1. Start herdr's TUI in a terminal and run a full-screen program in a pane.
  2. Run herdr terminal attach <terminal_id> from a pty of a different size (this is what the bridge's pty-host does), or open the pane in a focused web UI tab.
  3. In the TUI, type and click in the pane.

A second way: attach at the pane's current size, then resize the TUI's window. The pane does not follow.

Unreleased changes on main

Notes

Activity

  1. devswha commented on Oct 10, 2026

    @devswha
    OwnerAuthor

    Reproduced on main 5d18c53 with herdr 0.9.3. The size hold is herdr's attach contract (herdrdev/herdr#5036 was closed as intended behaviour), and herdr reports no pane width, so the bridge cannot join at the pane's own size. Waiting on herdrdev/herdr#4682; measurements added there.

  2. added a commit that references this issue on Oct 26, 2026
    e49276d
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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions