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
VS Code theme style is added to text copied to the clipboard as rich text instead of plain text. #67702
Comments
Most programs copy and paste rich text where possible, and some of the nice ones (Chrome, Office) offer a paste-as-plain-text functionality on the assumption that what's in the clipboard has both rich and non-rich versions. I think the current setting is a sensible default. |
Most programs are not code editors. I can think of many reasons how this "feature" is a bug, but no reasons why this is useful. VS Code Version: 1.38.1 |
I also think the default should be to copy as plain text since that is my most common use case – I'm pasting into chat, email, Google Doc and I don't want my syntax theme in those environments. I can't think of a common use case where you want the opposite. |
Take a look at: "Copy with syntax highlighting" got hundreds of thumbs up in 2016. (That issue was locked in 2017.) But your "Copy as plain text" only gets three now. (It's three years since 2019.) Which side wins? "Copy with syntax highlighting" should be the default. Indeed, VS Code writes both plain text and HTML into clipboard, and it's the target application that decides which format to paste. (#57577 (comment)) |
@Lemmingh thumbs-driven development, huh... I guess most people who don't need the black background when pasting stuff to Gmail, are not familiar with github and issue-trackers. Also, the issue you linked says "add ability", not "make it default" |
Thank you for the discussion, and consideration for inclusion into the backlog. I can see why lots of people would want to create presentations, chat or write emails with syntax highlighting themed exactly as they see it on their screen, and I get the reason why this got voted in as a standard feature for VS Code. As the primary use case for VS Code is for developers writing and discussing code, copying over syntax highlighting is helpful, and appropriate. The default behavior of copying the entire display theme as-is, including the background seems inappropriate when copying code for even on-screen consumption that have the opposite light (or dark) background, and worse for more longer-term documentation or instruction to be viewed on a printed (or e-book) page. The default behavior is made more jarring when working with Markdown or Plain Text files across other notetaking apps that respect rich-text formatting. I know this can be overridden at paste time by using Ctrl-Shift-V in SOME apps, but in Microsoft Word, it's an extra menu step to select Keep Text Only. My request is not that the feature be removed, but to be made more refined. Formatting in an IDE is applied to the content by the environment, and are not applied properties to the content itself by the author. As the expectation for most rich-text formatting is to paste into documents with dark-text on a white background (to make situations involving printing to paper less complicated), I believe VS Code's designers could envision a default behavior that applies a default syntax highlighting color scheme WITHOUT an included background color that would work optimally for light backgrounds, but also be more than legible if pasted into a presentation with a dark background. Thank you for all your hard work. |
One more point: this is not the default behavior in the "full" Visual Studio (non-code). The behavior should be consistent across products. |
what are some things we could do to make this more visible, aside from tweeting about it? |
As far as I'm aware, this issue is eventually about the default value of the
Let the data speak. This is reasonable under limited resource constraints. VS Code's wiki also conveys such idea. Given that VS Code can even encourage users to join GitHub, I think the thumbs here should be sufficient. I searched for similar issues. It appears roughly 100 for
This has been discussed many times:
Well, let's take a glance at how clipboard transfers data again. A clipboard can hold multiple objects of different formats (called "MIME type" on web platforms). When writing to the clipboard (copy), an application is expected to put the data in many possible types. When reading from the clipboard (paste), an application selects the one it prefers. When copying in VS Code, a few objects are written into the clipboard, usually plain text ( Here are a few guidelines about interacting with the clipboard.
I'm afraid this is a misnomer. Visual Studio and Visual Studio Code are totally different products, just like Java and JavaScript are totally different languages. I'd suggest avoiding expressions like "full / slim Visual Studio". Here are Visual Studio's options.
You can change the default in Options > Advanced. |
"Java and JavaScript" is a fine example of poor naming and a branding disaster. Just like "Visual Studio and Visual Studio Code" is poor naming and a branding disaster. And it's a pain to google for things, because you get mixed results. So yeah, most people call it "full" Visual Studio. |
Issue Type: Bug
Expected: plain text pasted only.
Also opened before by @alex-jitbit
#63154
Reported as a "feature" that can be turned off by @rebornix, and indeed it can be turned off with "Editor: Copy With Syntax Highlighting"
HOWEVER, I believe that this should NOT be default behavior, and at the least believe that the "text background" should NOT be copied along with it, and the un-highlighted text be turned to black when copied as rich-text in the clipboard.
Platform: Windows
VS Code version: Code 1.30.2 (61122f8, 2019-01-07T22:54:13.295Z)
OS version: Windows_NT x64 10.0.17134
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Extensions (1)
The text was updated successfully, but these errors were encountered: