Skip to content

TUI form is 31 lines and never scrolls, so it overflows an 80x24 terminal #287

Closed

Description

@TMHSDigital

Summary

The TUI's configuration form renders 31 lines and never scrolls, so on a standard 80×24 terminal some of it can't be shown. Below the 23 field rows sit the key hints and the line that shows a validation error, so a short terminal can hide either the first fields or the error that explains why ctrl+r did nothing.

Where

  • internal/tui/form.go (formModel.View): writes the title, every field row, then the error or loading line and the key hints, with no regard for the terminal height
  • internal/tui/model.go (Model.View): alt-screen view of the full form content; m.height is tracked but only the scan view uses it

Details

Measured with newFormModel(savedConfig{}).View(): 31 lines at the current HEAD (23 field rows plus the title, the gap lines and the hints), and 28 before the three #274 fields were added. Either way it is more than a 24-row terminal holds, and a visible validation error adds two more lines.

Impact

TUI users on default-size terminals, small tmux panes or split IDE terminals. The form looks complete at a glance, but rows are missing, and a rejected run gives no visible reason when the error line is the part cut off.

Steps to reproduce

  1. Size a terminal to 80×24.
  2. Run subenum -tui.
  3. Count the visible rows against the 23 fields, or leave Domain empty and press ctrl+r to look for the error line.

Suggested fix

Render the field rows through a window that keeps the focused row visible when height is smaller than the form (the scan view already sizes itself from m.height). Always keep the error or loading line and the hints on screen. A compact two-column layout above a width threshold is an alternative.

Acceptance criteria

  • At 80×24 the focused field, any validation error and the key hints are always visible.
  • Tabbing from Domain to the last field and back keeps the focused row on screen.
  • A test renders the form at a small height and checks the above.

Getting started

  • Relevant files: internal/tui/form.go, internal/tui/model.go
  • How to run tests: go test ./internal/tui/

Related: #274


Filed by repo-audit/fix-issues at d0c56f0. Severity: medium. Effort: M. audit-key: bug|internal/tui/form.go|formModel.View-height

Activity

  1. added
    bug
    help wanted
    area: tui
    severity: medium
    on Nov 14, 2026
  2. TMHSDigital commented on Nov 15, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in d826821.

    The form now follows the terminal's height. When it does not fit, it drops the two-line logo first, then shows a window of field rows that always contains the focused one, with ↑ N more fields / ↓ N more fields markers. The error or loading line and the key hints are always drawn. On a tall terminal the form looks as before. The form reopened with r after a scan gets the current size too.

    Verified with TestFormFitsShortTerminal (80x24 with a validation error: tab through every field and back, checking each view is at most 24 lines and contains the focused row, the error and the hints; also a wrapped 280-character value and a 40-line terminal) and TestFormAfterScanKeepsTerminalSize. Both fail without the change. go test ./... and golangci-lint run pass.

    I took the windowing approach rather than the two-column layout. Below roughly 8 lines the view can still be taller than the terminal; the focused field is still drawn.

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: tuibughelp wantedseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions