Errors occur unless no-clipboard option is used in WSL
Steps to reproduce:
- install in WSL (
yarn global add serve) - 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.
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.
This is a duplicate of #533.