-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix(tui): improve macOS terminal restoration on exit #7860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
fix(tui): improve macOS terminal restoration on exit #7860
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
| @@ -1,5 +1,15 @@ | |||
| import { RGBA } from "@opentui/core" | |||
|
|
|||
| export function isMacOSTerminal(): boolean { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isMacOSTerminal: additional OS tests may be added in a follow up PR to be more cross platform compatible.
Testing for Windows is outside of the scope of this PR.
fixes: #7861 |
Add comprehensive macOS terminal handling to prevent 'dead terminal' issues: - Enhanced signal handling for SIGINT, SIGHUP, SIGTERM - Improved suspend/resume with proper alternate screen buffer management - Comprehensive exit cleanup with terminal reset sequences - Added macOS terminal detection utility Ensures terminal is properly restored to usable state when opencode shuts down, preventing scrambled terminals and requiring manual resets. 00-00000244
Add comprehensive test utility for macOS terminal functionality: - Tests macOS terminal detection logic - Validates terminal reset escape sequences - Verifies signal handler setup and cleanup - Mocks renderer for isolated testing Ensures terminal restoration changes work correctly across different macOS environments. 00-00000232
Add macOS terminal restoration testing to CI workflows: - Test script runs on macOS runners in nix-desktop workflow - Test script runs on macOS Tauri builds in publish workflow - Validates terminal restoration before desktop builds - Ensures future changes don't break macOS terminal functionality 00-00000fd9
000b3b0 to
000466a
Compare
fixes: #7861
Summary:
Fixes the "dead terminal" issue that occurs when opencode exits on macOS, leaving users with a corrupted terminal state that requires manual reset.
Changes:
Technical Details:
Testing: