Skip to content

fix: canonical term size model for shell resize#13

Merged
lyx-tec merged 1 commit into
mainfrom
fix/shell-resize-race
Jun 28, 2026
Merged

fix: canonical term size model for shell resize#13
lyx-tec merged 1 commit into
mainfrom
fix/shell-resize-race

Conversation

@lyx-tec

@lyx-tec lyx-tec commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Replace fire-and-forget resize events with a canonical term size state model. Term size is now block-level canonical state (stored in DB), not an event racing through the controller input channel.

Key changes:

  • Add ApplyTermSize to Controller interface (Shell/Session/Tsunami)
  • Add SetTerminalSize(blockId, size): write DB canonical + best-effort apply
  • Add getLatestTermSize(blockId): fresh DB read for shell startup
  • New SetTerminalSizeCommand RPC; frontend syncControllerTermSize uses it
  • run() and startNewJob() read canonical size instead of rtOpts snapshot
  • ResyncController writes rtOpts.TermSize to canonical on entry
  • ControllerInputCommand handler strips TermSize (routes to SetTerminalSize)
  • Remove updateTermSize and term-size handling from ShellController input goroutine

Invariants:

  • resize always writes canonical state first
  • shell startup always reads fresh canonical from DB

Replace fire-and-forget resize events with a canonical term size state
model. Term size is now block-level canonical state (stored in DB),
not an event racing through the controller input channel.

Key changes:
- Add ApplyTermSize to Controller interface (Shell/Session/Tsunami)
- Add SetTerminalSize(blockId, size): write DB canonical + best-effort apply
- Add getLatestTermSize(blockId): fresh DB read for shell startup
- New SetTerminalSizeCommand RPC; frontend syncControllerTermSize uses it
- run() and startNewJob() read canonical size instead of rtOpts snapshot
- ResyncController writes rtOpts.TermSize to canonical on entry
- ControllerInputCommand handler strips TermSize (routes to SetTerminalSize)
- Remove updateTermSize and term-size handling from ShellController input goroutine

Invariants:
- resize always writes canonical state first
- shell startup always reads fresh canonical from DB
@lyx-tec
lyx-tec merged commit e1e82a5 into main Jun 28, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant