PlatformIO Community

Cannot copy and paste examples in VS Code + Mac

Hi there,

am I doing wrong or can I really not copy anythin from a library texts, including examples? I can select the example’s code, but cannot copy it to an empty file. Is this expected?

latest VS Code, latest PlatformIO IDE

thanks a lot

I think this could be related to a issue in PIO Home and input focus… if you open PIO home, click on some other element of vscode - menu, activity bar icon, etc - PIO Home will lose (keyboard) input focus, and there doesn’t seem to be any way to get it back, bar closing the PIO Home tab and trying again. So, for instance, if you opened up the libraries view, searched for your library, highlighted the example code, and used the keyboard shortcut to copy it, that seems to work… but if you hightlight the code, and use the menu bar edit -> copy menu… you’ll get nothing :frowning:

Yeah that seems like it. Is this a problem with IDE or VSCode?

I’m not sure… I’m guessing it something to do with how the viewer window into PIO home is implemented, as it’s actually mini webserver instance, which you can access with a web browser… but once it loses keyboard focus, it seems it can’t regain it.

Edit: It’s a VSCode bug -

I’ve got the same issue with on Mac and my friend has the same issue on Fedora 30.

If you’re trying to use Ctrl+C to copy… you’re probably butting heads with the


Workaround (as mentioned in that thread)… double click the PIO Home tab when you find that keyboard input is not working…

I confirm this is an issue with PlatformIO and VS Code on Mac (tried two) and Ubuntu Linux, I’ve just tried it. All OSes, PIO and VSCode are newest production releases (no beta) to this date.

on Windows, there is no such problem.

I cannot copy-paste anything from the examples. To show where I am trying to copy from, see attachment (I select the text and press CMD+C on mac or CTRL+C on Linux):

I’m running both Windows 10 and Linux on multiple systems, and I have this issue on both OSes… so for me at least, this is not Linux specific.

Double clicking on the PIO home tab when unable to type, use Ctrl+C or give any other keyboard input to PIO Home resolves the issue on both OSes for me.