exit on remote system after privilege escalation clears clipboard #7109

Closed
opened 2026-01-31 00:55:16 +00:00 by claunia · 3 comments
Owner

Originally created by @CosmicCatnap on GitHub (Mar 23, 2020).

Environment

Microsoft Windows [Version 10.0.18362.720]

Steps to reproduce

  1. ssh to remote linux system
  2. escalate to root
  3. copy and paste a command
  4. issue exit command to return to login user
  5. notice the clipboard has been cleared after this command

Expected behavior

clipboard should persist

Actual behavior

clipboard is empty

Originally created by @CosmicCatnap on GitHub (Mar 23, 2020). # Environment ```Microsoft Windows [Version 10.0.18362.720]``` # Steps to reproduce 1. ssh to remote linux system 2. escalate to root 3. copy and paste a command 4. issue exit command to return to login user 5. notice the clipboard has been cleared after this command # Expected behavior clipboard should persist # Actual behavior clipboard is empty
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 00:55:17 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 23, 2020):

Thanks for the report! There's only one way for a text-mode application, especially one on Linux (or OS X), to change the state of the clipboard on the computer running the terminal. That's to use an escape sequence -- OSC 52, if i recall -- that tells the terminal what to put on the clipboard.

Terminal has never implemented OSC 52, which means that all clipboard modification happens as a result of user action. There's nothing that sudo or exit or your shell can do to change the contents of the clipboard today.

Can you share a screen recording of this happening?
Thanks!

@DHowett-MSFT commented on GitHub (Mar 23, 2020): Thanks for the report! There's only one way for a text-mode application, especially one on Linux (or OS X), to change the state of the clipboard on the computer running the terminal. That's to use an escape sequence -- `OSC 52`, if i recall -- that tells the terminal what to put on the clipboard. Terminal has never implemented OSC 52, which means that all clipboard modification happens as a result of user action. There's nothing that `sudo` or `exit` or your shell can do to change the contents of the clipboard today. Can you share a screen recording of this happening? Thanks!
Author
Owner

@CosmicCatnap commented on GitHub (Mar 23, 2020):

If you are unable to reproduce or unwilling I can't help further. Good luck

@CosmicCatnap commented on GitHub (Mar 23, 2020): If you are unable to reproduce or unwilling I can't help further. Good luck
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 23, 2020):

I'm willing to reproduce, I just can't. There's nothing in Terminal that knows anything about elevation, especially not over ssh, so I can't even begin debugging this without additional information.

@DHowett-MSFT commented on GitHub (Mar 23, 2020): I'm willing to reproduce, I just can't. There's nothing in Terminal that knows anything about elevation, especially not _over ssh_, so I can't even begin debugging this without additional information.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7109