When you paste code, copied from VSCode, you can unfortunately get the background colour as well
To get round this, you can copy the code into an application that doesn’t allow formatting, like Notepad. This will remove the background colour and the rest of the formatting and will allow you to past it into your desired application. while this works, its not ideal.
This is something that really annoys me, so I often do a quick Bing search to see if there are any solutions. Yesterday I came across
What this settings change does, is to allow you to copy and paste from VSCode without any formatting or syntax high lighting. This still isn’t perfect, but it cuts out the step using Notepad.
To enable this, open VSCode (I’m using the insider version, but it will work in both) and browse to File > preferences > Settings
Type editor.copyWithSyntaxHighlighting in the search bar and then untick the box labelled Controls whether syntax and then close the settings page
You can now copy and paste without the black background (and the code highlighting obviously)
Like I said, not a fix, but a shorter work around. Thanks @rebornix