Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
li-yechao wants to merge4 commits intocoder:mainfromli-yechao:fix/safari-clipboard

Conversation

li-yechao
Copy link

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

@li-yechaoli-yechao requested a review froma team as acode ownerJune 3, 2025 15:04
@li-yechaoli-yechao changed the titleSupport read clipboard in safariFix Clipboard Access Issue for VIM Extension in SafariJun 3, 2025
@li-yechaoli-yechao changed the titleFix Clipboard Access Issue for VIM Extension in SafariFix clipboard access issue for VIM extension in safariJun 3, 2025
@li-yechao
Copy link
Author

Although this patch might seem a bit like a hack, it works surprisingly well in Safari.

@code-asher
Copy link
Member

code-asher commentedJun 3, 2025
edited
Loading

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.

@li-yechao
Copy link
Author

@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.

@li-yechao
Copy link
Author

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.

@code-asher
Copy link
Member

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?

@li-yechao
Copy link
Author

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 "vim.useSystemClipboard": true,p (paste function) in vim mode will be unavailable (in safari), because vscode's clipboard API callsnavigator.clipboard.readText(), which must be called in events directly triggered by the user in webkit-based browsers, and vscode calls this API in the request of VIM Extension.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@li-yechao@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp