[GH-ISSUE #283] bug: Does not switch to correct screen after suspend #75

Open
opened 2026-03-02 23:44:21 +03:00 by kerem · 0 comments
Owner

Originally created by @veracioux on GitHub (Nov 8, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/283

Reproducible with opencode:

https://github.com/user-attachments/assets/58ed1ff4-9efa-47c7-8e41-02b7c165a015

Cause:
Editors like neovim, emacs, etc switch to the alternate screen. If this screen doesn't match the configured screen of the CliRenderer (determined by useAlternateScreen), the terminal clearing commands in performShutdownSequence are applied to the wrong screen.

Fix:
Ensure the correct screen (determined by useAlternateScreen) before starting the render loop, by emitting the appropriate ANSI sequences.


Related to https://github.com/sst/opencode/issues/3648.

Originally created by @veracioux on GitHub (Nov 8, 2025). Original GitHub issue: https://github.com/anomalyco/opentui/issues/283 Reproducible with opencode: https://github.com/user-attachments/assets/58ed1ff4-9efa-47c7-8e41-02b7c165a015 **Cause:** Editors like neovim, emacs, etc switch to the alternate screen. If this screen doesn't match the configured screen of the CliRenderer (determined by `useAlternateScreen`), the terminal clearing commands in performShutdownSequence are applied to the wrong screen. **Fix:** Ensure the correct screen (determined by `useAlternateScreen`) before starting the render loop, by emitting the appropriate ANSI sequences. --- Related to https://github.com/sst/opencode/issues/3648.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#75
No description provided.