microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
110.68k stars 6.52k forks source link

Paste As Plain Text - retain original clipboard content #24468

Open shem-sargent opened 1 year ago

shem-sargent commented 1 year ago

Description of the new feature / enhancement

Currently, "the formatted text in the clipboard is replaced with the unformatted text." This feature adds a Paste As Plain Text Settings option for the clipboard to contain the original formatted content following the operation.

This feature would allow me to use Ctrl +V to paste formatted and Ctrl + Shift + V to paste as plain text in any order as many times as needed in any application.

Scenario when this would be used?

When producing technical documentation, I need to have both formatted and unformatted forms of the same content available for pasting without a predictable sequence in various applications.

Supporting information

I acknowledge the technical challenges to implement this, as discussed in #1684. Based on the collective knowledge shared there, it seems that it is technically infeasible to avoid modifying the clipboard content prior to the system paste operation. There is apparently no callback from the system paste operation, so timing clipboard content changes to replace its content after the operation may also be problematic. The contributors to that discussion mentioned other tools and alternate implementation methods that have their own limitations, but which hint at the possibility of better solutions.

I also realize that the best solution may be outside the scope of this product. I believe that the system paste operation would benefit greatly from some improvements along these lines. The In the meantime, PowerToys may be able to demonstrate the demand and need for such improvements.

I should also note that the Windows Clipboard History feature retains formatted content, but it requires mouse actions to switch between formatted and plain text content, which is an efficiency killer in my usage context. It's actually easier to go back and copy the original formatted content again.

I hope the PM's and the community at large consider this to be challenge worthy of a better solution that allows for a more flexible user experience. I can imagine building additional future features on such a solution that allow for more customized and accelerated actions that leverage the familiar paste functionality.

crutkas commented 1 year ago

We are aware of this, the current behavior does mimic how clipboard history works.

Great ask

asheroto commented 9 months ago

Yes, this would be great.

To illustrate a method of how it could be done, the rich text could be stored in a var temporarily, the clipboard could be set to plain text, pasted, the clipboard could be restored to the temp var.

This is how I'm doing it in AutoHotkey just to illustrate the method.

; Paste Plaintext
^+v::
    ClipSaved := ClipboardAll
    tempClipboard := clipboard
    Clipboard := tempClipboard
    Send, ^v
    Sleep, 500
    Clipboard := ClipSaved
return