bugthesystem / vscode-open-in-github

Extension for Visual Studio Code which can be used to jump to a source code line in Github, Bitbucket, GitLab and Visualstudio.com
MIT License
197 stars 73 forks source link

Bug: “Copy GitHub link to clipboard” doesn’t work in remote VS code #147

Closed daiyunxu-stripe closed 1 year ago

daiyunxu-stripe commented 1 year ago

“Copy GitHub link to clipboard” doesn't work in the context of VS Code Remote Development.

It is one of the common problems #using-the-clipboard when it comes to remote development. User expects to see extension interacting with clipboard on the local system instead of the remote one.

Using VS code api vscode.env.clipboard.writeText should fix the bug. It can get access to the local clipboard and write to the correct place. Example: https://code.visualstudio.com/api/advanced-topics/remote-extensions#using-the-clipboard

I've opened a PR to this fix this bug https://github.com/ziyasal/vscode-open-in-github/pull/146 and confirmed it was working in both local vscode and remote vscode.