Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xclip fails with Error: Can't open display: (null) #4933

Closed
Gorthog opened this issue Feb 26, 2020 · 11 comments
Closed

xclip fails with Error: Can't open display: (null) #4933

Gorthog opened this issue Feb 26, 2020 · 11 comments
Labels

Comments

@Gorthog
Copy link

Gorthog commented Feb 26, 2020

  • Your Windows build number: Microsoft Windows [Version 10.0.19041.84]

  • What you're doing and what's happening:

sudo apt install xclip
echo 111 > xclip
  • What's wrong
    nothing was copied. instead the following error message appeared:

Error: Can't open display: (null)

I'm trying to make xclip work so I can use 3rd parties programs like micro which rely on xclip to copy the clipboard.

@therealkenc
Copy link
Collaborator

Your $DISPLAY is not set.

$ export DISPLAY=<x11-server-ip>:0

Similar #2975 see #646 (message) et al. You'll need an X Server of choice (such as VcXsrv) listening on <x11-server-ip>. Watch out gotcha #4106 aka #4619 on WSL2.

@dwmkerr
Copy link

dwmkerr commented Jul 27, 2020

Unfortunately I couldn't get this to work either. My approach was to fall back on this:

alias pbcopy="clip.exe"
alias pbpaste="powershell.exe -command 'Get-Clipboard' | head -n -1"

More details at #1069 (comment)

@gastonfun
Copy link

Hi, its my first post and cuestion and problem, pls Help me!
I´m Gaston, from Buenos Aires Argentina.
Ok the problem is whit adding ssh key to git agent. y cant copy i tried all ....
Like sinapis ...I'm trying to make xclip work so I can use 3rd parties programs like micro which rely on xclip to copy the clipboard.
But no way! cant copy my key. here is a capture from Ubuntu server 20 HA! I´ve installed MAAS over ubuntu its allfine Help Help Help! y nooooob in this im learning plis helpis :D
VirtualBox_UbuntuServer_25_09_2020_19_49_11 ssh key

@gastonfun
Copy link

Hi, its my first post and cuestion and problem, pls Help me!
I´m Gaston, from Buenos Aires Argentina.
Ok the problem is whit adding ssh key to git agent. y cant copy i tried all ....
Like sinapis ...I'm trying to make xclip work so I can use 3rd parties programs like micro which rely on xclip to copy the clipboard.
But no way! cant copy my key. here is a capture from Ubuntu server 20 HA! I´ve installed MAAS over ubuntu its allfine Help Help Help! y nooooob in this im learning plis helpis :D
VirtualBox_UbuntuServer_25_09_2020_19_49_11 ssh key

y Tried this: https://www.digitalocean.com/community/questions/copy-ssh-key-to-clipboard
i´ve folowed this directions: https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

@Gorthog
Copy link
Author

Gorthog commented Oct 3, 2020

for now i'm using this as workaround:
#4852 (comment)

@evandrouzeda
Copy link

I use
xclip -d :0 -i test.txt -selection clip
and work for me

@koushik355
Copy link

Not related to Xclip but you want to copy anything on WSL. Use clip.exe
Something like this

cat testing.txt | clip.exe

The content of testing.txt will be copied in the clipboard in this case.

@brandoncroberts
Copy link

Not related to Xclip but you want to copy anything on WSL. Use clip.exe
Something like this

cat testing.txt | clip.exe

The content of testing.txt will be copied in the clipboard in this case.

best comment!

@koushik355
Copy link

On another note, you can pretty much access many windows services from WSL itself.
Like
explorer.exe . would open the file explorer from your current dir that you're on WSL.
You will have to find the .exe that you run from the Run and you can execute it in WSL.

@Gorthog
Copy link
Author

Gorthog commented Jun 16, 2021

xclip on wsl2 requires xserver and I had corruption with clip.exe. That's why I use utf8clip. See #4852 (comment)

@cjadeveloper
Copy link

Not related to Xclip but you want to copy anything on WSL. Use clip.exe
Something like this

cat testing.txt | clip.exe

The content of testing.txt will be copied in the clipboard in this case.

Not related to Xclip but you want to copy anything on WSL. Use clip.exe
Something like this
cat testing.txt | clip.exe
The content of testing.txt will be copied in the clipboard in this case.

best comment!

Yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants