Most of the time people copy rich text from their browser or some application, and want to insert the text without the source (or any) formatting. Some applications allow to _Paste as plain text_ (e.g. browser, or some Linux distros) using Ctrl+Shift+V
. However, a global Windows shortcut would solve a lot of trouble, preferably to Ctrl+Shift+V
this is a great idea.
I love this idea, I often find myself using this and improvise from either using a notepad to using random third party apps like PureText but none of them is easy. having them in PowerToys is amazing. I can help too
Up-voted! Also as an improvement to what PureText already does, can we add a UI option to enable filtering out any trailing CR/LF characters before pasting?
When I do copy/paste into my command line prompt from (say) a web page, I normally want to edit the text I've pasted before executing it, to avoid any potentially dangerous consequences. Removing all trailing CR/LFs would help preventing automatic execution.
@crutkas, does it sound like a feasible feature?
Updated, I've open-sourced my own side project for copy-pasting in plain text and more. Hopefully, it might be useful to others.
this seems like a great feature. I use run prompt as my scratch pad to unformat text all the time.
I feel like Ctrl+Shift+C
for Copy as plain text would also be useful.
I feel like
Ctrl+Shift+C
for _Copy as plain text_ would also be useful.
Some apps already use that shortcut as well as Ctrl+Shift+V
For pasting as plain text. It would be trivial
I would look at this feature as one of 2 potential paths: it either has a UI (on keypress), or it doesn't. If it _does_ have a UI, then this can be quite an expansive feature later. I personally use Ditto (link) which does several things on Ctrl+Shift+V (by default), mainly showing a paste buffer history, like this (it can do images, note the search down bottom, etc.):
Upon selecting the top item (click or Enter), it's pasted. If you press Shift+Enter, it pastes without formatting. FWIW, I find this to be quite intuitive.
In the PT case, I think the overlapping issue is #671 (though that layout is much too whitespace-y for my taste :wink:). I just wanted to add to the discussion pasting with or without formatting and _which item_ you're pasting in a history context matters and these two will inevitably inter-relate. We should consider that when choosing shortcuts given the relatively few default possibilities.
As with many of the PT proposals, I definitely recommend looking at existing behaviors, like Ditto and others, and see how they look and feel.
As with many of the PT proposals, I definitely recommend looking at existing behaviors, like Ditto and others, and see how they look and feel.
The built-in Win10 Clipboard Manager (Win+V) should be able to fit nicely in this picture, too. IMO, ideally the clipboard management should be the feature of Windows, not PT.
A shameless plug, you may want to try out the related tool I maintain, DevComrade
. Among other things, it allows to use Win+Ins for pasting a single unformatted line, so nothing gets executed automatically. Time permitting, I'm going to explore Monitoring Clipboard Contents API and more modern WinRT's Clipboard Class to see if I can integrate it with Win10 Clipboard Manager.
Excellent idea!
Coming back to say we need this. I am using PureText.exe (Win+V) but the ask is really to make Ctrl-Shift-V a WINDOWS GLOBAL STANDARD for pasting as Plain text. Chrome and Teams already do this. on
to make Ctrl-Shift-V a WINDOWS GLOBAL STANDARD for pasting as Plain text.
@shanselman, perhaps, the challenge to make it work for _all existing apps_ is to settle on how to implement it. There are a few options but none is perfect, IMO:
Simulate typing via SendInput
. I've tried this approach (see my comment above) and while it works generally well, simulating typing is an async process by its nature and there may be some side effects. I had to tackle them on per-app basis. I still use this approach for apps like Windows Terminal and VS Code via a custom hotkey (Win+Ins). I think PureText also uses SendInput
, and in my experience, it wasn't always reliable, sometimes nothing was getting pasted.
Sanitize the clipboard by stripping out formatting _when_ new rich text is copied, using something like Clipboard Monitoring API. Then Ctrl+V simply works. This is what I currently use the most and I find it the best compromise, but it's still not perfect. There are rare cases when I need to paste rich formatting, so I disable filtering manually (with a timeout to enable it back automatically).
Sanitize the clipboard right upon Ctrl+Shift+V, then simulate Ctrl+V and perhaps restore the clipboard formatting afterwards. This is non-deterministic because there's no feedback from the app as to when the text has been pasted. So it leaves a gap for side effects as well, but it's still a viable option to explore.
Make Windows Clipboard API return plain text as long as Shift key is hold (perhaps, the best option, but I wouldn't keep high hopes 馃檪 about this).
Introduce some new Win32 standard (like WM_PASTEPLAINTEXT
) and some UWP standard to encourage the new apps to adopt pasting plain text. Not a 100% solution but would be the right thing to do.
Any other ideas? // @crutkas
https://stevemiller.net/puretext/ does it reliably and has for years. What does Steve do?
https://stevemiller.net/puretext/ does it reliably and has for years. What does Steve do?
Could be just "my machine", but with PureText I'd often hit Win+V and nothing would happen, besides the beep. Especially with console apps. I only started playing with a custom app because of this.
But it doesn't seem to be open source
But it doesn't seem to be open source
PureText doesn't seem to be open-source, but another popular app mentioned here, Ditto Clipboard Manager, is.
My tool DevComrade
is also open-source.
@crutkas What about an integration?
This issue has the "Help-Wanted" label. Someone could help integrate DevComrade? Ditto is not an option because its GPL licensed
This issue has the "Help-Wanted" label. Someone could help integrate DevComrade? Ditto is not an option because its GPL licensed
I think we need first decide on what the pasting behavior should be, given the current array of implementation options. What DevComrade does really isn't a universal solution (see my comment above), it's just something that has worked for me.
E.g., I prefer stripping out formatting upon copying in-place in the clipboard, so later Ctrl+V just does the default thing for the current app.
This issue has the "Help-Wanted" label. Someone could help integrate DevComrade? Ditto is not an option because its GPL licensed
I think we need first decide on what the pasting behavior should be, given the current array of implementation options. What DevComrade does really isn't a universal solution (see my comment above), it's just something that has worked for me.
E.g., I prefer stripping out formatting upon copying in-place in the clipboard, so later Ctrl+V just does the default thing for the current app.
Then it is something that we would have to wait for a while OR manage behavior customization after the "integration"
Love to hear what @crutkas thinks about this.
to me, the ask here is be consistent across everything,
This could be a service but no matter what, it has to be able to be run as admin due to scenarios like Terminal is being run as admin. If you have just gotten into muscle memory of using that shortcut, it won't fire unless this process is admin
force a paste
@crutkas, I wonder how exactly do you plan to force the paste? I can think of the following options:
SendInput
I've actually tried both and they both have some shortcomings I mentioned in the comments above.
I'm embracing my PM role right now for expectations.
My first round of people to chat with is the Win-V team and see what they did.
My first round of people to chat with is the Win-V team and see what they did.
馃憤 Please report back to the community 馃檪
Most helpful comment
I feel like
Ctrl+Shift+C
for Copy as plain text would also be useful.