Git Product home page Git Product logo

Comments (3)

issuehunt-oss avatar issuehunt-oss commented on June 2, 2024

@sindresorhus has funded $36.00 to this issue.


from clipboardy.

rfgamaral avatar rfgamaral commented on June 2, 2024

The trick is, native windows binaries need to be on a letter drive to run (e.g. C: drive).

Are you sure about this? I just did some debugging on my WSL 1 instance (I don't have WSL2 for testing) and it works fine with a simple change:

1) Initialize a project like this:

/tmp
❯ mkdir clipboard
mkdir: created directory 'clipboard'

/tmp
❯ cd $_

/tmp/clipboard
❯ npm init --yes               
Wrote to /tmp/clipboard/package.json:

{
  "name": "clipboard",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}



/tmp/clipboard
❯ npm i --save clipboardy             
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 21 packages from 8 contributors and audited 24 packages in 2.721s
found 0 vulnerabilities

2) Add an index.js file with (for testing purposes):

const clipboardy = require('clipboardy');

clipboardy.writeSync('🦄');

3) Change linux in node_modules/clipboardy/index.js line 20 to windows (this is just for testing purposes, not production code).

4) Execute in your shell:

/tmp/clipboard
❯ node index.js

5) Paste (with Ctrl+V or something) into a Windows application and observe clipboardy working.

You can also test the pasting action and you'll see it also works just fine, try it.

I was going to tackle this issue on Issue Hunt but the fix feels quite simple and it's basically point 2 in the original post. I'm not the one who deserves it. Unless I'm missing something here? Perhaps this doesn't quite work on WSL 2?

from clipboardy.

issuehunt-oss avatar issuehunt-oss commented on June 2, 2024

@sindresorhus has rewarded $32.40 to @g-rath. See it on IssueHunt

  • 💰 Total deposit: $36.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $3.60

from clipboardy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.