I want to cut and paste from cmd and keep the color information when pasting to another application. It's similar to pasting in most applications with formatting information.
Is there a way to do this? Or can it be done with an app similar to cmd?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityThe PowerShell folks, on their blog, posted an article titled: Colorized capture of console screen in HTML and RTF
Once it's in a RTF file, with colors, open the RTF with Word or OpenOffice and copy the text to your target application.
As PowerShell is a nice replacement of cmd.exe with a lot more features, give it a try.
Windows Terminal can be handy with its copyFormatting
setting (https://docs.microsoft.com/en-us/windows/terminal/customize-settings/interaction).
Snark's answer is useful, but the link is broken. The updated link to the MSDN blog post is here: Colorized capture of console screen in HTML and RTF
You need to copy the functions from the blog post and then paste them into PowerShell. And then you can run commands like:
$htmlFileName = "$env:temp\ConsoleBuffer.html"
.\Get-ConsoleAsHtml | out-file $htmlFileName -encoding UTF8
Colours in cmd are not the same as normal colours, it's the interpreter interpreting colour codes. I do not believe it's possible to do, and checking in Console2, it can't do it either, so it's probably for a very good reason.
There is a long winded way of doing it, using screen capture?
mspaint
Then those screen capture shots, will be ready to be inserted into Word as an image for documenting purposes. Of course, it's not text, so it won't be selectable. But it may be better than nothing.