zadjii-msft / PowerToys

Windows system utilities to maximize productivity
MIT License
3 stars 2 forks source link

Add a clipboard API helper that allows extensions to easily copy the content from the clipboard #83

Open joadoumie opened 1 month ago

joadoumie commented 1 month ago

Description of the new feature / enhancement

There are a lot of use cases already where extensions need to be able to easily access the clipboard. Let's let em!

Scenario when this would be used?

Whenever an extension needs to access the clipboard, it should be as simple as possible to do so... an extension developer can just leverage to add text on to the clipboard.

Tasks

joadoumie commented 1 month ago

@zadjii - we had this at some point -- it was commented out for some reason. We probably need to confirm this is the right way to do this though?

zadjii commented 1 month ago

Clint commented it out because it didn't pass the PowerToys linters. We can probably uncomment it (and fix the linter warnings).

I originally lifted that from PowerShell. They've got a lot of the same technical problems we have in this regard. powershell.exe isn't actually a process with a foreground window (like our extensions). So someone that wants to copy to the clipboard in a PowerShell script would have a hard time without a helper.