Vscode: copy/paste with another theme

Created on 18 Feb 2017  路  22Comments  路  Source: microsoft/vscode

image

Turn on default dark them
edit a markdown file
copy, paste text into email

result: the black background of the text is also pasted into the email. I just want the text...

image

I turned on the dark theme in Visual Studio, copy/pasted some code, and here are the results. the first block of code is the copy/paste from VS, the second is the copy/paste from VS Code:

image

*out-of-scope editor-clipboard feature-request

Most helpful comment

Adding my voice to the mix, I agree with @oxydron it should be

  • ctrl+c (or copy) should copy only text
  • Provide a copy with formatting option
  • Provide a different shortcut for it like ctrl+shift+c

Text editors that copy plaintext with ctrl-c:

  • SublimeText
  • Atom
  • Notepad++
  • BBEdit
  • EditPlus
  • Notepad
  • Eclipse
  • Kedit
  • TextEdit

Editors that copy with theme formatting with ctrl-c:

  • VS Code

All 22 comments

Is this related #20811?

Firstly, we can't just copy the colored text without background as in Dark theme, the font color is light (sometimes just white) so copying white text with no background is not reasonable. You can hardly see anything when pasting it to a light themed application.

Visual Studio has three built-in themes, even if you are in Dark theme, the content is always copied with the light theme. So this feature request is actually similar to Copy text with Syntax Highlighting in another specific theme. It's easy to do so as VS gets all ideas about the light theme but for us, as we support third party themes, we cannot decide what theme to use when copy/paste so right now we choose the one users are using at the moment.

For short, temporary workaround is switching to the ideal theme you want to copy/paste. In the long term, we can provide an option for users to configure what theme they want to use for copy/paste. But users need to pay the price of this feature: we have to render all lines with correct CSS class/styles if you choose any theme other than the one you are using, it might take a while.

Strong request to improve this feature.
Copy the text to Outlook, there is a large black with background color.
But copy to Micorsoft Lync, no background color, it's difficult to read text as below picture.
untitled

Very thanks for your effort.

I think the feature should be that you can set one theme for display, and a separate theme for copy/paste.
I'd like to set my display theme to Dark+ (default dark), but when I copy and paste to another application with formatting, I want the theme to be Light+ (default light). So there should be a way of selecting those two themes separately.

If nothing else, perhaps there should be a user setting where I can override the theme to apply to copied text.

I would like to voice my support here -- while I prefer to write code with a dark background, any time I copy/paste it to another app, itll be going against a white background. Neither paste-with-background or paste-without-background are good options, there, and it would really be best to simply copy as if i were using a light theme.

Copy command should be neutral, copy only text and nothing else more.
I need to open my stuff on another editor just to copy text neutral.

This is becoming too annoying that I'm considering getting back to sublime only because of this tiny issue. Let it be at least configurable like: copyRawTextOnly or something.

There are times where we want to copy/paste with language syntax highlight, that is fine. But if the text is ie. Markdown, a .txt file or just a opened unsaved buffer, then it is raw text and nothing else, so avoid styles and coloring in these situation please.

@fungos and moreover, most text editors I record, do copy/cut operations neutral. To copy stuff with themes, colors, etc, should be a special feature, not the standard option, different from most text editors.

A simple solution would be to have two capabilities, copy with formatting and copy without formatting, and then let the users decide which one is used when Edit -> Copy is chosen; they can put the other on a different key combination, if desired.

The summary then:

  • ctrl+c (or copy) should copy only text
  • Provide a copy with formatting option
  • Provide a different shortcut for it like ctrl+shift+c

VSCode really lags behind with this feature. Really wish this was present - maybe as someone suggested, that copy+paste works on a default theme always and display has a different theme.

Adding my voice to the mix, I agree with @oxydron it should be

  • ctrl+c (or copy) should copy only text
  • Provide a copy with formatting option
  • Provide a different shortcut for it like ctrl+shift+c

Text editors that copy plaintext with ctrl-c:

  • SublimeText
  • Atom
  • Notepad++
  • BBEdit
  • EditPlus
  • Notepad
  • Eclipse
  • Kedit
  • TextEdit

Editors that copy with theme formatting with ctrl-c:

  • VS Code

This is a big productivity breaker. Copy/Paste into a Gmail email has become very cumbersome. Somehow, I did not notice that until a few months ago.

My workaround right now is to paste it into an empty sublime text tab and then copy paste it back to gmail. I really love VSCode, and I am 99% migrated to VSCode, but for this "feature".

I think the default should be without style, but even if the default is with style, we should have at least a way to copy text only.

Plain text copying should be the default.

@rebornix

For short, temporary workaround is switching to the ideal theme you want to copy/paste. In the long term, we can provide an option for users to configure what theme they want to use for copy/paste.

why not providing an option to use text copying by default?

From https://github.com/Microsoft/vscode/issues/21071#issuecomment-303750728

Make this a user setting like "editor.copyWithFormatting" and with the options true/false.

p.s. I use dark theme but I usually copy-paste the code as plain text. It's very inconvenient right now and I have to open some other editor and first paste the code there...

+1 This really is a no-brainer user setting to add, in fact, if nothing else, it should be turned off by default.

+1. This is a necessity.

While waiting for a fix, I hacked up an ugly bit of Swift (my first time coding Swift) that removes the background color on OS X.

https://gist.github.com/pragdave/6fc95ff2420dea51842717a5da7a98ff

Is anyone working on this? It's very annoying. It's hard to believe that this is not bothering more people, ;)

In latest Insiders, you can disable copy with syntax highlighting by setting editor.copyWithSyntaxHighlighting to false and command "Copy with syntax highlighting" still works as expected.

Right now, we don't have plan to support copying with another theme in the near term.

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

The config setting which allows switching to a plain text copy editor.copyWithSyntaxHighlighting pointed out by @rebornix above is available in the stable release now (possibly since some time ago).

Was this page helpful?
0 / 5 - 0 ratings