Align OSC 52 behavior with terminal norms: default term:osc52=always, focus gating only in focus mode#2975
Open
Align OSC 52 behavior with terminal norms: default term:osc52=always, focus gating only in focus mode#2975
term:osc52=always, focus gating only in focus mode#2975Conversation
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Deploying waveterm with
|
| Latest commit: |
ac855da
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://db99c71b.waveterm.pages.dev |
| Branch Preview URL: | https://copilot-add-global-config-op.waveterm.pages.dev |
Copilot
AI
changed the title
[WIP] Add global config option for term:osc52 handling
Add configurable OSC 52 focus policy (Mar 4, 2026
term:osc52) with block-level override support
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot
AI
changed the title
Add configurable OSC 52 focus policy (
Align OSC 52 behavior with terminal norms: default Mar 4, 2026
term:osc52) with block-level override supportterm:osc52=always, focus gating only in focus mode
| return false; | ||
| }); | ||
|
|
||
| handleOsc52Command("c;SGVsbG8=", "block-1", true, { nodeModel: { isFocused: {} } } as any); |
Contributor
There was a problem hiding this comment.
WARNING: Test mock may not accurately represent the actual atom behavior
The isFocused field is being set to an empty object {}, but in the actual implementation (line 127 of osc-handlers.ts), globalStore.get(termWrap.nodeModel.isFocused) expects an atom. The test currently passes because the mock's default return value is false, not because it's properly testing an unfocused atom.
Consider creating a proper mock atom that explicitly returns false when accessed via globalStore.get() to make the test more robust and clear about what it's testing.
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (10 files)
|
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.
This updates OSC 52 clipboard behavior to match common terminal defaults.
term:osc52now defaults toalways, and focus checks are only enforced when mode is explicitlyfocus.Behavior change in OSC 52 handler
handleOsc52Commandnow treatsalwaysas unrestricted with respect to window/block focus.document.hasFocus()+ block focus) is applied only whenterm:osc52 === "focus"."focus"to"always".Configuration defaults
pkg/wconfig/defaultconfig/settings.json:"term:osc52": "always"Docs alignment
docs/docs/config.mdxto reflect:alwaysalwaysallows writes anytimefocusrequires focused window + focused blockTargeted test coverage
frontend/app/view/term/osc-handlers.test.ts:focusstill rejects unfocused blockalwaysallows unfocused blockalwaysallows writes when window is unfocusedalways✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.