dupe - #4215
Closed
frankischilling wants to merge 2 commits into
Closed
dupe#4215frankischilling wants to merge 2 commits into
frankischilling wants to merge 2 commits into
Conversation
Keep each probe result separate from the selected clipboard method, and wait only when accessing an external system register. Preserve internal fallback and explicit backend refresh, with regression tests for pending detection and mode changes.
Member
|
While it more or less duplicates #4105 + #2245 I'm unsure if it is worth the additional complexity in |
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.
Slow PATH searches and clipboard-tool probes can delay micro's first frame in WSL. This starts detection through
clipper.GetClipboardAsync, with the worker and result synchronization owned by clipper. Micro uses the existing Clipboard interface and handles its own mode selection and internal fallback.Depends on zyedidia/clipper#6. This branch pins the published fork revision
3095b365e472through a documentedgo.modreplacement so reviewers and CI can build it without a local workspace. Replace that pin with an upstream clipper revision before merging.The custom
micro-clipcommand keeps its priority. Internal registers, terminal clipboard access, and their multi-cursor operations remain available during detection. Failed startup detection is logged on first external clipboard use and falls back to internal storage. Explicit initialization refreshes detection and restores internal storage on failure without overwriting a later method selection.README guidance covers Windows Terminal's OSC 52 option, and option help explains the remaining wait on first system clipboard use.
Closes #4209.
Validation
GOWORK=offand the published dependency pin.go test -race -count=20on Windows and Linux.go test -run '^$' -bench . -benchmem -count=1 ./....The broader Windows
cmd/microrace test still reports buffer hashing/highlighting races, and full micro vet reports existing warnings. Both reproduce on unchanged upstream393cf248. Clipper's Windows vet warning atwinapi.go:90also reproduces in unchanged v0.1.1; its other vet checks and Linux vet pass.Startup measurements
Rerun on September 8 with Go 1.27.1. The three Linux binaries use the same
-trimpath -buildvcs=falsebuild flags with CGO disabled: upstream393cf248, the previous PR revision33548404, and this revision using clipper3095b365e472.The runner measures process launch to the first buffer-content output in a controlling PTY. WSL is already running; settings and input files are identical; one warmup per build/case is excluded; and build order rotates evenly. No tests or builds ran alongside the timing samples. These are real clipboard probes, without artificial delays. PATH has 53 entries, including 44 Windows paths, and this environment selects
xclip, not the reporter's PowerShell backend./mnt/c/ external/mnt/c/ terminalThe revised Linux-filesystem/external runs ranged from 9.86 to 16.22 ms, compared with 9.57 to 24.09 ms for the previous PR and 100.06 to 180.74 ms for upstream. Moving detection into clipper shows no meaningful startup slowdown in this sample. The roughly 91% lower median applies to this measured case. Mounted-filesystem results are noisy with overlapping ranges, and the first external clipboard operation can still wait for detection.