Coder Social home page Coder Social logo

Comments (5)

e-zk avatar e-zk commented on May 19, 2024 1

This is what I've done in the past to get around this: https://github.com/e-zk/cpass/blob/master/main.go#L53

Checking the version string in /proc for "microsoft-standard"1 may not be the most robust solution for checking whether the distro is WSL.

Footnotes

  1. https://github.com/e-zk/wslcheck/blob/main/wslcheck_unix.go

from clipboard.

mikutas avatar mikutas commented on May 19, 2024 1

This works better with WSL
https://github.com/golang-design/clipboard

from clipboard.

k1ng440 avatar k1ng440 commented on May 19, 2024

not pretty but this is just an one minute hack

	var clipPath string
	if _, err := os.Stat("/c/Windows/system32/clip.exe"); !os.IsNotExist(err) {
		clipPath = "/c/Windows/system32/clip.exe"
	} else if _, err := os.Stat("/mnt/c/Windows/system32/clip.exe"); !os.IsNotExist(err) {
		clipPath = "/mnt/c/Windows/system32/clip.exe"
	} else

	p := fmt.Sprintf("Bearer %s\n", re.IdToken)
	if clipPath != "" {
		sh.Run("bash", "-c", fmt.Sprintf("echo '%s' | %s", p, clipPath))
	}
```

from clipboard.

tomasaschan avatar tomasaschan commented on May 19, 2024

I'm tempted to take a stab at this; hub also uses this library.

@atotto Would a PR that looks for clip.exe on Linux be accepted (assuming code quality is OK etc, of course)?

from clipboard.

AnomalRoil avatar AnomalRoil commented on May 19, 2024

This would also solve gopasspw/gopass#1664 on our side 👍

from clipboard.

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.