Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard commands don't work on Linux Wayland #17561

Open
5 tasks done
AimVaguely opened this issue Jun 22, 2022 · 5 comments
Open
5 tasks done

Clipboard commands don't work on Linux Wayland #17561

AimVaguely opened this issue Jun 22, 2022 · 5 comments
Labels
Hacktoberfest Potential candidate to participate in Hacktoberfest Issue-Enhancement the issue is more of a feature request than a bug Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module

Comments

@AimVaguely
Copy link

Prerequisites

Steps to reproduce

When using Wayland on Linux, when I try and use set-Clipboard it completes, but when I ctrl + v it doesn't paste what I copied, it pastes what was in the clipboard already. If I then use get-clipboard it outputs what I set in set-clipboard. The reason I believe this is to do with Wayland, is due to the note in the Set-Clipboard docs, where it says "On Linux, this cmdlet requires the xclip utility to be in the path.", but if you look at xclip's README, it says "xclip is a command line utility that is designed to run on any system with an X11 implementation" (emphasis added), and Wayland is different to X11, and therefore it won't be compatible. The solution that other applications have implemented, is to use wl-clipboard when running in Wayland.

Expected behavior

CTRL + V: this is example text copied before setting it in PowerShell
PS> Set-Clipboard "new text"
CTRL + V: new text
PS> Get-Clipboard
new text

Actual behavior

CTRL + V: "this is example text copied before setting it in PowerShell"
PS> Set-Clipboard "new text"
CTRL + V: "this is example text copied before setting it in PowerShell"
PS> Get-Clipboard
new text

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Linux 5.18.5-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Thu, 16 Jun 2022 20:40:47 +0000
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@AimVaguely AimVaguely added the Needs-Triage The issue is new and needs to be triaged by a work group. label Jun 22, 2022
@PaulHigin PaulHigin added the WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module label Jun 27, 2022
@SteveL-MSFT SteveL-MSFT added Hacktoberfest Potential candidate to participate in Hacktoberfest Issue-Enhancement the issue is more of a feature request than a bug Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors and removed Needs-Triage The issue is new and needs to be triaged by a work group. labels Oct 4, 2022
@SteveL-MSFT
Copy link
Member

The cmdlet is currently hardcoded to use xclip if running on Linux. It would be a worthwhile change to use wl-clipboard instead if xclip isn't available or if it can be easy to detect that Wayland is being used.

@sidverma32
Copy link

@AimVaguely @SteveL-MSFT Can i take up this issue?

@dkaszews
Copy link
Contributor

dkaszews commented Oct 5, 2022

@sidverma32 If you mean you want to create a PR, sure 😊 . Especially since it has "Up-for-Grabs" label.

@sidverma32
Copy link

The cmdlet is currently hardcoded to use xclip if running on Linux. It would be a worthwhile change to use wl-clipboard instead if xclip isn't available or if it can be easy to detect that Wayland is being used.

This only needs to be updated inside GetText() function not in SetText?

@ghost ghost added the In-PR Indicates that a PR is out for the issue label Oct 6, 2022
@ghost ghost removed the In-PR Indicates that a PR is out for the issue label Nov 6, 2022
@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution-No Activity Issue has had no activity for 6 months or more label Nov 15, 2023
@AimVaguely
Copy link
Author

This issue persists, as I just tested on version 7.3.9. The same behaviour that I noted above.

As a workaround, I have just been using wl-paste in all the scripts that I make.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Resolution-No Activity Issue has had no activity for 6 months or more label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Potential candidate to participate in Hacktoberfest Issue-Enhancement the issue is more of a feature request than a bug Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants