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

Set-Clipboard -Remote with OSC52 #9300

Closed
2 tasks done
dkaszews opened this issue Oct 11, 2022 · 0 comments · Fixed by #10118
Closed
2 tasks done

Set-Clipboard -Remote with OSC52 #9300

dkaszews opened this issue Oct 11, 2022 · 0 comments · Fixed by #10118
Labels
area-management Area - Microsoft.PowerShell.Management module issue-doc-idea Issue - request for new content
Milestone

Comments

@dkaszews
Copy link

dkaszews commented Oct 11, 2022

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

Added switch -AsOSC52 (alias -ToLocalhost) which uses OSC52 escape sequence to set the clipboard of the host (system running terminal) instead of target (system actually running PowerShell).

Details

The documentation should explain the following:

  • Difference between host and target when remoting and why this feature is useful.
  • OSC52 needs to be implemented by the terminal, is supported by most (including Windows Terminal), but not all (notably missing gnome-terminal, the default terminal on many Linux distros, including Ubuntu).
  • Terminal multiplexers such as screen and tmux may interfere and require additional configuration.
  • If does not work, OSC52 is the term to search for.
  • Get-Clipboard equivalent is considered a security risk and not implemented in PowerShell nor any terminal of note, but can be retrieved simply with Ctrl+Shift+V.
  • Optional hint for the user: they can add $PSDefaultParameters['Set-Clipboard:AsOSC52'] = $env:SSH_CLIENT -or $env:SSH_TTY to their $PROFILE to automatically choose the correct method when connecting over SSH.

Articles

  • reference/7.3/Microsoft.PowerShell.Management/Set-Clipboard.md

Related Source Pull Requests

Related Source Issues

@dkaszews dkaszews added issue-doc-idea Issue - request for new content needs-triage Waiting - Needs triage labels Oct 11, 2022
@sdwheeler sdwheeler added area-management Area - Microsoft.PowerShell.Management module hold-for-pr Waiting - for PR merge hold-for-release Waiting - for next release and removed needs-triage Waiting - Needs triage labels Oct 11, 2022
@sdwheeler sdwheeler added this to the 7.4 milestone Oct 11, 2022
@sdwheeler sdwheeler modified the milestones: 7.4, Future Jan 10, 2023
@sdwheeler sdwheeler removed the hold-for-pr Waiting - for PR merge label May 8, 2023
michaeltlombardi pushed a commit that referenced this issue Jun 1, 2023
* Add -AsOSC52 parameter

* Add examples to avoid build error
@sdwheeler sdwheeler removed the hold-for-release Waiting - for next release label Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-management Area - Microsoft.PowerShell.Management module issue-doc-idea Issue - request for new content
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants