Skip to content

TUI: prompt box reserves 8 blank rows in narrow terminals when the footer wraps #44551

Closed

Description

@hiroyuki117339

Description

On a narrow terminal, the prompt box at the bottom of the TUI reserves a large block of blank rows that nothing is drawn into. At 50 columns it takes 15 rows, 8 of which are blank — roughly a third of the screen on a phone-sized terminal.

It correlates with how much the prompt footer wraps. The same session, same terminal size, with and without --auto (which adds the auto chip to the footer and pushes it from 3 wrapped lines to 4):

opencode --auto -s <session> at 50x40 — prompt box is 15 rows, rows 29-36 are blank:

12	     ▣  Build · Ox Alpha Free (Unlimited) · 9.5s
13
...	     (message area, blank)
21
22	  ┃
23	  ┃
24	  ┃
25	  ┃  Builauto·Ox Alpha Free (Unlimited) Ope·m
26	  ┃  d                                  nCo a
27	  ┃                                     de  x
28	  ┃                                     Zen
29	  ┃
30	  ┃
31	  ┃
32	  ┃
33	  ┃
34	  ┃
35	  ┃
36	  ┃
37	  ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
38	   /Users/hiroyuki/           24.9K (2ctrl+p
39	   CascadeProjects/totteta            commands

opencode -s <session> at 50x40 (same session, no --auto) — prompt box is 6 rows, no blank rows:

12	     ▣  Build · Ox Alpha Free (Unlimited) · 9.5s
13
...	     (message area, blank)
30
31	  ┃
32	  ┃
33	  ┃
34	  ┃  Buil ·Ox Alpha Free (Unlimited) OpenC· ma
35	  ┃  d                               ode Z  x
36	  ┃                                  en
37	  ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
38	   /Users/hiroyuki/           24.9K (2ctrl+p
39	   CascadeProjects/totteta            commands

Measurements

All on one session with a single short exchange (message area does not fill the viewport), pane size set with tmux new-session -x/-y.

Width sweep, height fixed at 40, with --auto:

Width Prompt box height
50 15 rows (8 blank)
56 9 rows
64 8 rows
72 7 rows (footer fits on one line)

Height sweep, width fixed at 50, with --auto: 30, 40 and 60 rows all give a 15-row prompt box. The wasted height is constant, not proportional to the terminal.

Two more data points:

  • It does not reproduce once the conversation is long enough to fill the viewport — the prompt box collapses back to 4-5 rows. The box seems to absorb leftover vertical space and over-reserves when the footer wraps.
  • A fresh session on a shorter model name (DeepSeek V4 Flash / OpenCode Go, no variant chip) does not reproduce at 50x40 even with --auto, because the footer only wraps to 2 lines. So the trigger looks like total footer width rather than --auto specifically.

prompt.max_height in tui.json has no effect on this. I tested unset, 3 and 20 at 50x24 and got the same box height in all three.

Steps to reproduce

  1. Start a session and send one short message, so the message area does not fill the screen.
  2. Reopen that session in a 50x40 terminal with a long model name and the auto permission chip visible, e.g. opencode --auto -s <session-id>.
  3. The prompt footer wraps to 4 lines and the prompt box takes 15 rows, the last 8 of which are blank.
  4. Reopen the same session without --auto. The footer wraps to 3 lines and the prompt box takes 6 rows.

Environment

  • OpenCode 1.18.21
  • macOS 26.6.2
  • tmux (pane sized with -x/-y); originally hit through Mosh from an iPhone, which is where a 50-column terminal is normal
  • Plugins: opencode-sentinel

Activity

  1. hiroyuki117339 commented on Aug 24, 2026

    @hiroyuki117339
    Author

    Closing as resolved — this turned out to be a rendering/display bug in the Moshi iOS terminal app (SSH & MOSH terminal, App Store id6757859949), not in opencode itself.

    The blank-row display issue only appeared through Moshi on iPhone (narrow 50-column terminal). It does not reproduce in a normal terminal or tmux at the same size with the same opencode binary (verified with the stock 1.18.22 build). A Moshi app update resolved the display corruption, so there was no opencode-side change needed.

    Thanks for the detailed repro steps either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions