Skip to content

Initialize clipboard asynchronously to avoid startup delay in WSL2#4105

Open
PetarPeychev wants to merge 1 commit into
micro-editor:masterfrom
PetarPeychev:clipboard-fix
Open

Initialize clipboard asynchronously to avoid startup delay in WSL2#4105
PetarPeychev wants to merge 1 commit into
micro-editor:masterfrom
PetarPeychev:clipboard-fix

Conversation

@PetarPeychev
Copy link
Copy Markdown

Description

I had a very slow startup time in WSL2. Tracked this down to clipboard initialization in clipper.GetClipboard. Either the inherent WSL2 interop cost or perhaps the "powershell.exe Get-Clipboard" .NET cold start.

Changes

There may be a better way to solve this (neovim seems to use https://github.com/equalsraf/win32yank) but I've just moved the initialization to a goroutine here. This reduced startup on my machine from ~800ms down to ~60ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant