fix: refresh probability improvements and instance switch fixes#20
Merged
fix: refresh probability improvements and instance switch fixes#20
Conversation
PR13 added scrollback: 10000 to xterm.js Terminal configuration and documented it in ARCHITECTURE.md. This documentation line was accidentally removed when the Terminal Protocol Timing Specification was added in later commits. This restores the client-side config documentation while preserving all TUI and anomalous string fixes from the current branch.
When a TUI program (like opencode) enables mouse tracking mode and the user switches to another instance, xterm.js continues generating mouse event sequences. These were being sent to the new instance's PTY and displayed as garbage text like "35;29;1M35;29;2M...". Root cause: Terminal modes (including mouse tracking) leak between instances because the same xterm.js terminal is reused across instance switches. Fix: Explicitly disable common mouse tracking modes when switching instances: - ?1000l: Disable mouse button press/release - ?1002l: Disable mouse drag tracking - ?1003l: Disable mouse all motion tracking - ?1006l: Disable SGR extended mouse mode This ensures each instance starts with a clean terminal state, preventing mode leakage from previous TUI programs.
Architecture updates (ARCHITECTURE.md §5.3): - Document mouse tracking mode reset in instance switch protocol - Add Step 1.3 for terminal mode reset before buffer clearing - Document that TUI programs re-initialize on SIGWINCH Test case updates (TERMINAL_TEST_CASES.md): - Add §7 ESC Key Handling test cases (6 cases) - Add §8 Instance Switch Terminal Reset test cases (5 cases) - Add §9 UTF-8 Multi-byte Handling test cases (4 cases) - Update test statistics from 27 to 42 cases - Expand manual testing section with instance switch scenarios Related: Fixes mouse event leakage when switching from TUI to shell instance
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.
Changes
Related
Branch: fix/refresh-prob-1