Plot pane and focus in vscode

Hi,

I have a problem when working in vscode. Figure produced within the vscode window are not easily “copy-able” (Julia: Copy Plot). It yields the error message: Failed to copy plot: Plot pane does not have focus
I need to click an unpredictable amount of times on the figure and at some point it might become “copy-able”.
As a result I end up making screenshots of most figures I make when working with Julia in vscode, which is a pity. I guess I’m not the only one :smiley:

Does any one know an easy fix?

Cheers

This PR of mine just got merged recently, but isn’t released yet Allow saving for Makie png/html plots and improve clipboard behavior by jkrumbiegel · Pull Request #3780 · julia-vscode/julia-vscode · GitHub

For me it seemed to mostly fix that issue, which had also annoyed me a lot. But it’s not a deterministic fix so I’ll wait and see how it performs in the wild. As far as I understood, the clipboard API needs to be triggered via a user-focused element so that the clipboard can only be written due to a user interaction. But apparently this focus detection is prone to race conditions, hopefully my PR helps by delaying the check a little bit after the button click.

1 Like