opencode icon indicating copy to clipboard operation
opencode copied to clipboard

OpenTUI: Missing main view text when resizing

Open Damond5 opened this issue 2 months ago • 8 comments

Description

Opening a new window in i3 makes the opencode window resize. After resize the text in the main view is missing.

OpenCode version

v1.0.7

Steps to reproduce

  1. Open opencode to fill the whole screen
  2. Open a 2nd window and split the screen in 2 windows (opencode + 2nd window)
  3. Expect opencode to resize and still show everything

Screenshot and/or share link

Image

Operating System

Arch Linux + i3

Terminal

Alacritty

Damond5 avatar Nov 01 '25 13:11 Damond5

This issue might be a duplicate of existing issues. Please check:

  • #3328: Same issue where TUI doesn't resize properly when window resizes, showing broken display
  • #3676: Window resizing doesn't work on Windows terminals with similar symptoms
  • #3394: OpenTUI resize issue where UI elements flow into each other after resizing

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Nov 01 '25 13:11 github-actions[bot]

After this happens, are you able to get the main view to display correctly by resizing the terminal window incrementally?

veracioux avatar Nov 01 '25 14:11 veracioux

After this happens, are you able to get the main view to display correctly by resizing the terminal window incrementally?

No, I tried resizing both horizontally and vertically, smaller and bigger. The main view stays empty.

Also tried scrolling up (with mouse wheel), to see if the text just got pushed, but nothing happens when I scroll.

Damond5 avatar Nov 01 '25 14:11 Damond5

Its like the main view has been cleared.

When I enter a new prompt, it starts populating again with blocks from the new prompt (the old blocks are still gone).

Damond5 avatar Nov 01 '25 14:11 Damond5

What I've noticed that if you keep the conversation going for a bit, then you scroll up, sometimes you can see the messages correctly. The resize trick works after using the /editor command only.

arsham avatar Nov 01 '25 15:11 arsham

If the content reappears after aggressive scrolling it is a known issue in the scrollbox clipping. I'll fix that in the opentui lib and add an option to turn clipping off in opencode implementation should it not get better.

kommander avatar Nov 01 '25 15:11 kommander

If the content reappears after aggressive scrolling it is a known issue in the scrollbox clipping. I'll fix that in the opentui lib and add an option to turn clipping off in opencode implementation should it not get better.

I think you've got it!

Had to spam scroll for 30+ seconds with my mouse, but eventually got to the old blocks.

Damond5 avatar Nov 01 '25 16:11 Damond5

https://github.com/sst/opencode/pull/3834

fixes it for me

0xrin1 avatar Nov 04 '25 13:11 0xrin1