code-server version: code-server2.preview.9-vsc1.37.0-linux-x86_64When trying to copy from terminal, get Cannot read property 'writeText' of undefined
Just select a text in terminal and copy
Are you accessing the IDE over HTTP? Chrome won't allow access to
the clipboard unless the page is either over HTTPS or localhost so
that might be what's happening here.
Yes, I use http. But I don't know how to go back to https without configuring cert. I remember first version is default to https (just start the code-server and then https runs).
@code-asher
Yeah v2 defaults to http. You can pass --cert to enable https. If
you don't specify a path it will generate a self-signed
certificate for you.
@code-asher I and --cert but still can't use https, the browser console print:
workbench.web.api.js:1538 WebSocket connection to 'wss://localhost:7777/?reconnectionToken=26068b2f-1fc2-4dd5-9438-070581b170cf&reconnection=true&skipWebSocketFrames=false' failed: WebSocket opening handshake timed out
clear all data in chrome and problem solved.Thanks
This has nothing to do with http or https, since copy paste does work in files but not in terminal. Having the same issue...
@jdelrue Any success...same issue with me. Cleared browser data too.
Are you guys using latest chrome?
I believe the reason it doesn't work with http is because the terminal uses the new clipboard API while the editor view uses the DOM and so can use the older execCommand API. See https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand and https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
Going to close unless you guys confirm you're using HTTPS.
Most helpful comment
Are you accessing the IDE over HTTP? Chrome won't allow access to
the clipboard unless the page is either over HTTPS or localhost so
that might be what's happening here.