- Notifications
You must be signed in to change notification settings - Fork6k
Fix clipboard access issue for VIM extension in safari#7366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Although this patch might seem a bit like a hack, it works surprisingly well in Safari. |
code-asher commentedJun 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you for the patch! Could this fix be sent upstream tohttps://github.com/microsoft/vscode? At a glance it seems like something that should be fixed upstream to me. The VS Code folks can probably give a better review than I can, but my gut says that specifically reacting to Vim keybindings in the core might not be the right implementation. |
@code-asher As you mentioned, I don’t think VSCode would accept this patch. Given that WebKit (the core of Safari) has no plans to open the clipboard API, and considering the limitations of both VSCode's architecture and WebKit, supporting this in a VSCode extension isn't feasible. For now, the only viable solution is to modify the VSCode core via a patch. |
Even if this PR doesn’t get merged, that’s perfectly fine—I totally understand. While this patch works, it is indeed quite a hack. My intention is simply to provide this solution for anyone who might find it useful. |
That makes sense! Yeah I think it is not something we should merge so I will close but we can use this as an example if anyone else has issues. Speaking of, what is the issue exactly? Is it that sometimes pasting does not work, specifically when pasting in rapid succession? |
When you install VIM extension and enable |
I typically use code-server in Safari with the VIM extension, but I've encountered issues with clipboard functionality due to the underlying VSCode architecture. After some exploration, I found a way to improve the clipboard experience in Safari: when certain events that can read the clipboard (such as pressing 'p' or 'ctrl+v') are triggered, the clipboard content is read into memory, and subsequent read requests within a short time window will return the cached content instead of reading from the clipboard