fix(terminal): add OSC 66 compatibility for older terminals#605
Merged
kommander merged 3 commits intoanomalyco:mainfrom Feb 2, 2026
Merged
fix(terminal): add OSC 66 compatibility for older terminals#605kommander merged 3 commits intoanomalyco:mainfrom
kommander merged 3 commits intoanomalyco:mainfrom
Conversation
55ab1f9 to
ed2d40e
Compare
@opentui/core
@opentui/react
@opentui/solid
@opentui/core-darwin-arm64
@opentui/core-darwin-x64
@opentui/core-linux-arm64
@opentui/core-linux-x64
@opentui/core-win32-arm64
@opentui/core-win32-x64
commit: |
Fixes compatibility issues with older terminal emulators (e.g., GNOME Terminal) that don't support OSC 66 escape sequences. These terminals were displaying visible artifacts containing "66" when OpenTUI applications ran. Changes: - Enhanced OPENTUI_FORCE_EXPLICIT_WIDTH environment variable to skip OSC 66 queries when set to "false" or "0" - Added skip_explicit_width_query flag to Terminal struct - Modified queryTerminalSend() to conditionally skip OSC 66 queries - Added comprehensive tests for the new behavior - Updated environment variable documentation - Added Terminal Compatibility section to development.md When OPENTUI_FORCE_EXPLICIT_WIDTH=false: - No OSC 66 queries (explicitWidthQuery, scaledTextQuery) are sent - explicit_width capability is disabled - No artifacts appear on older terminals Backward compatibility: - Default behavior unchanged (queries still sent by default) - Modern terminals continue to work as before - Only activates when user explicitly sets environment variable Tests: - Added 3 new tests for OSC 66 query behavior - All new tests pass (4/5 passed, 1 skipped for Windows) - All existing TypeScript tests pass (3136/3136) Documentation: - Added Terminal Compatibility section to packages/core/docs/development.md - Updated packages/core/docs/env-vars.md with clarified documentation
ff5a975 to
88edab1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes compatibility issues with older terminal emulators (e.g., GNOME Terminal) that don't support OSC 66 escape sequences. These terminals were displaying visible artifacts containing "66" when OpenTUI applications ran.
Changes:
When OPENTUI_FORCE_EXPLICIT_WIDTH=false:
Backward compatibility:
Tests:
Documentation: