serve icon indicating copy to clipboard operation
serve copied to clipboard

Errors occur unless no-clipboard option is used in WSL

Open jesselve opened this issue 5 years ago • 2 comments

Steps to reproduce:

  1. install in WSL (yarn global add serve)
  2. run in WSL (npx serve)

Result: ERROR: Cannot copy to clipboard: write EPIPE

Providing a directory argument yields a different error, e.g. npx serve build Result:

ERROR: Cannot copy to clipboard: Command failed: xsel --clipboard --input
xsel: Can't open display: (null)
: Inappropriate ioctl for device

Workaround: Providing the -n argument eliminates the error.

jesselve avatar Aug 03 '20 14:08 jesselve

For those of you who want wsl to be able to copy your clipboard from WSL to your clipboard, one way would be to have an x-server on windows and have your wsl environment setup to talk to the server.

I followed this article to get it setup: https://techcommunity.microsoft.com/t5/windows-dev-appconsult/running-wsl-gui-apps-on-windows-10/ba-p/1493242

This setup will allow you to more than just copy to the clipboard. Otherwise the workaround above is perfectly fine to use and remove the error.

talves avatar Oct 03 '20 18:10 talves

This is a duplicate of #533.

rigwild avatar Mar 04 '21 18:03 rigwild