Conversation
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Does PR need to receive a positive response in order to attract the attention of the maintainers? |
|
This issue still persists in version 1.18.14. |
|
@XiongHaoTrigger Thanks for confirming that this still happens on 1.18.14. The cleanup job used reactions as one of its criteria. This PR was closed because it was over a month old and had fewer than two positive reactions. The closure was automatic, not a sign that the bug was fixed. I have rebased the branch onto the latest dev and checked the current OpenTUI 0.4.5 teardown path. Raw mode is still disabled before native renderer cleanup, so this OpenCode-side reset is still needed. The focused renderer tests pass, along with the packages/tui typecheck, oxlint, git diff --check, and the full pre-push typecheck. Could a maintainer reopen this PR for review? The branch is current and ready. |
Issue for this PR
Closes #20458
Related: #11748, #32336
Type of change
What does this PR do?
destroyRenderer()cleared the terminal title and then delegated to OpenTUI teardown. In some shutdown paths, terminal private modes can survive exit, especially mouse reporting and bracketed paste, leaving the user's shell in a broken state.This PR centralizes the terminal reset contract in one
TERMINAL_MODE_RESETSregistry and writes the joined reset sequence before and afterrenderer.destroy(). The reset is idempotent and best-effort: a failed stdout write does not block renderer destruction.The covered shutdown cases are:
app.exit, scoped release, and SIGHUP already calldestroyRenderer()How did you verify your code works?
bun test test/util/renderer.test.tsbun run typecheckfrompackages/tuibunx oxlint packages/tui/src/util/renderer.ts packages/tui/test/util/renderer.test.tsgit diff --checkScreenshots / recordings
Not applicable. This is terminal teardown behavior covered by unit tests.
Checklist