Open ElanHasson opened 2 years ago
The extension actually runs on the VSCode server, which is the root of the issue.
The extension actually runs on the VSCode server, which is the root of the issue.
May I ask how to solve it? I have the same issue when I want to use it in my home-lab server with code-server. I have installed the xclip. It works well when I drap a file to the web (The file can be successful uploaded into the server). But I can't paste images to the server with this vscode extension.
@ElanHasson
This is because xclip does not work properly under the dev container. Maybe the DISPLAY environment variable was not been set correctly in your dev container.
you can check by run xclip -h
command in container to confirm it work or not.
If not work, you should set your DISPLAY environment variable first. For example:
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=":99.0"
Hi. It would be awesome if this issue would be fixed :) I'm using code-server for personal knowledge management (foam, but in web browser) and I think this issue might be similar or the same as in devcontainer.
There's some information I found so far: https://github.com/coder/code-server/issues/1849 https://github.com/dendronhq/dendron/issues/749
So the solution might be correctly using clipboardy https://code.visualstudio.com/docs/remote/troubleshooting#_clipboard-does-not-work
Best regards
I think I'm running in the same problem, despite not being a "dev container".
Using VS Code 1.67.2 on Windows 10, with Remote Server running Ubuntu.
When I try to paste I get nothing, on checking the extension's log, I get "Clipboard Type: -1 no xclip" but there isn't "xclip" on Windows.
So I thought, ok maybe the extension thinks it's running on Linux because of the remote stuff. Installed xclip on the remote server, but now the error is "Can't open display: (null)" - because, of course, there's no display there since I use it as a remote server only.
Which is curious, since it is installed locally and not on the remote server.
@ElanHasson
This is because xclip does not work properly under the dev container. Maybe the DISPLAY environment variable was not been set correctly in your dev container.
you can check by run
xclip -h
command in container to confirm it work or not.If not work, you should set your DISPLAY environment variable first. For example:
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & export DISPLAY=":99.0"
How can I do this in docker-compose?
Would implementing this into the extension help? https://code.visualstudio.com/api/advanced-topics/remote-extensions#using-the-clipboard
@chtran46 No. It missing the ability to read non-text clipboard data.
I filed the issue about this last year: https://github.com/microsoft/vscode/issues/139761
Since the VS Code issue is not expected to be fixed, I created a simple extension for myself. I hope this will be useful to someone.
https://marketplace.visualstudio.com/items?itemName=watahani.markdown-image-paste-for-remote
The dev container believes it's running linux, so it does not work for pasting images in that environment. Even directly in WSL, I get an invalid image being saved.