0

I run a code server on one machine in my home lab and access it via Safari browser on another MacBook. I use http to connect to the code server and am able to access my projects and develop just fine.

The problem is that I am not able to Copy text from the terminal (in the VS Code running in the browser). I have tried everything, including tweaking the settings file but I cannot seem to get the "copy" action to work. Often times there are error messages that I would like to copy and paste for searching on google, but it just doesn't work.

If I run the actual VS code app, then I can copy paste just fine from terminal window of VS Code. But I prefer the browser version.

Here is what I have as settings for workbench.action.terminal.copyselection { "workbench.colorTheme": "Default Dark Modern", "workbench.startupEditor": "none", "terminal.integrated.scrollback": 20000, "terminal.integrated.commandsToSkipShell": [ "workbench.action.terminal.copySelection", "workbench.action.terminal.paste" ], "terminal.integrated.copyOnSelection": true, "terminal.integrated.defaultProfile.osx": "bash", "terminal.integrated.sendKeybindingsToShell": true, "editor.minimap.enabled": false }

Here is what I have in settings.json for the copyOnSelection:

{ "workbench.colorTheme": "Default Dark Modern", "workbench.startupEditor": "none", "terminal.integrated.scrollback": 20000, "terminal.integrated.commandsToSkipShell": [ "workbench.action.terminal.copySelection", "workbench.action.terminal.paste" ], "terminal.integrated.copyOnSelection": true, "terminal.integrated.defaultProfile.osx": "bash", "terminal.integrated.sendKeybindingsToShell": true, "editor.minimap.enabled": false }

Keyboard shortcuts bindings for workbench.action.terminal.copySelection are:

{ "key": "cmd+c", "command": "workbench.action.terminal.copySelection", "when": "terminalFocus && terminalHasBeenCreated && terminalTextSelected || terminalFocus && terminalProcessSupported && terminalTextSelected" },

But CMD + C still does not copy, I have tried pasting in terminal and also other editors. (Both Server and client machines are Macs) Any advice on how to resolve this is much appreciated.

Curious101
  • 1,538
  • 2
  • 18
  • 36
  • What's the keyboard shortcut you have bound to the `workbench.action.terminal.copySelection` command? What do you see when you [troubleshoot your keybindings](//github.com/microsoft/vscode/wiki/Keybinding-Issues)? Please paste the relevant parts of what you see into a code block in your question post. – starball Aug 04 '23 at 05:58
  • Thanks @starball. I looked through the keybindings link you shared and do not see anything that applies to my setup on Mac. I'm using MacBook Pro with the keyboard provided with the laptop. no external keyboard. no re-mapping. – Curious101 Aug 04 '23 at 06:40
  • Interestingly, when I go to "Developer: Toggle keyboard shortcuts troubleshooting" it takes me to the output tab on the bottom window (where I have terminal) and from the output I can copy text just fine. So it is only in the terminal area where I cannot copy the text. Also, when I press CMD + C on output window, I see the logs being generated for key presses. But I see no logs generated in output window for the CMD + C pressed in the terminal window. – Curious101 Aug 04 '23 at 06:42
  • I really appreciate your patience with me, @starball. I hope I found the information you were asking for (added it to my original question). The keybinding is CMD + C. But that does not work in terminal (browser connected to Code server). Also, if it matters the context menu "Copy" option also does nothing. I've tried both copy methods and pasted in terminal or other editors and I do not get the intended copy text from terminal. – Curious101 Aug 06 '23 at 07:51
  • Please always [edit] clarifications into your question post instead of hiding them in the comments! Comments are for _soliciting_ clarifications- not for providing them. – starball Aug 06 '23 at 08:11
  • 1
    not sure if any of these are related: https://github.com/coder/code-server/issues/237, https://github.com/coder/code-server/issues/1402, https://github.com/microsoft/vscode-remote-release/issues/2564, https://github.com/microsoft/vscode-remote-release/issues/5905 – starball Aug 06 '23 at 08:18
  • Thanks @starball. The links you've shared are related to the issue I have. It seems there is no solution at the moment. If I can switch to https, that might help possibly resolve the issue. I will need to look into that as I need some more work in regards to DHCP reservation and local network dns resolution before I can add self signed certs into the mix. I appreciate your help. – Curious101 Aug 07 '23 at 01:23
  • 1
    tell me how that goes. I can write up an answer with what you find, or you can do it yourself. – starball Aug 07 '23 at 01:33

0 Answers0