Repository navigation
fix(ui): restore mouse after source editor return - #276
Merged
Merged
Conversation
Mirror the annotation editor's terminal restoration while preserving source reload behavior and respecting disabled mouse tracking.
phewitt
marked this pull request as ready for review
July 18, 2026 00:32
umputun
approved these changes
Jul 18, 2026
umputun
left a comment
Owner
There was a problem hiding this comment.
logic looks correct and matches the annotation path from #235. All five return paths restore mouse cell motion, --no-mouse still wins via the mouseTracking gate, and batching with the reload cmd is safe. One test-coverage nit before merge, the added tests don't actually pin the fix in place:
openSourceEditorsetsrestoreMouse: m.cfg.mouseTracking(app/ui/editor.go:154) inside thetea.ExecProcesscompletion closure, but no test invokes that closure, so deleting the line leaves every test green while reintroducing the bug. A case that setsmouseTracking=trueand asserts the propagated flag would catch it.- the stale-tree (
:359) and changed-file (:363) branches returnrestoreMouseCmd, but the only tests covering them (SkipsReloadWhen*) leaverestoreMousefalse and assertcmd == nil, so reverting either toreturn m, nilstill passes. Extend theRestoresMouseTrackingtable with arestoreMouse:truecase that hits each mismatch branch.
both minor, production behavior is right on all five paths.
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.
Problem
Opening a source file with
ereleases the terminal throughtea.ExecProcess, but the source-editor completion path does not restore mouse tracking afterward. This leaves mouse input disabled after both clean and error returns.Solution
Mirror the existing annotation-editor behavior by re-enabling mouse cell motion when the session started with mouse tracking enabled. Preserve the source-editor reload behavior by batching restoration with the reload command when both are needed, while continuing to respect
--no-mouse.Fixes #275