mjmlio / vscode-mjml

MJML preview, lint, compile for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=attilabuti.vscode-mjml
MIT License
178 stars 25 forks source link

Copy on headless Linux (no clipboard) #52

Closed mcorrigan closed 1 week ago

mcorrigan commented 1 month ago

Before you open an issue, please check if a similar issue already exists or has been closed before.

Expected behavior

The task for copy the html to the clipboard would work (or we have another way to get the code, like another editor window)

Please provide a description of the behavior you expect. I have some software that runs on Raspbian (Debian Bookworm), and I want to use the Copy html task so I can get at the final code produced by mjml. At this point, the clipboard behavior is a plugin called copy-paste which is set to use xclip which is only available with linux with a head.

Actual behavior

The task gets run but nothing gets added to the clipboard (there is no clipboard buffer access that I am aware of headless)

Please provide a description of the actual behavior you observe.

The task Copy HTML is run. The clipboard does not change.

Steps to reproduce the problem

  1. Use a headless version of linux (debian bookworm)
  2. Connect your VSCode to be remotely editing files over ssh.
  3. With an mjml file of valid code, use Ctrl+P and then type ">MJML: Copy HTML" - the message "Copied!" will display
  4. Try pasting the expected HTML anywhere

Code sample

<mjml>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>
          Hello world
        </mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Screenshot / GIF

Please attach screenshot/gif if you consider them as helpful to understand/reproduce the issue.

N/A

Specifications

Other information

List any other information that is relevant to your issue.

I spent some time trying to figure out a way to display a quick panel with the HTML, but my knowledge of VSCode is not to that level. Sorry. I also stripped out the PhantomJS code as it does not have prebuilt binaries for arm64. Which was simple enough and seemed to make no difference in the copy functionality listed above.

iRyusa commented 1 week ago

We're now using built in API from vscode in 2.0 does it work for you ?

mcorrigan commented 1 week ago

Awesome! I did a quick test and it looks like it worked, I'll continue to play around with it and see if I run into any trouble. Thanks for the fix!