Visual Studio Code 如何从终端复制彩色语法
我在 Linux Ubuntu(虚拟机上)上运行 Visual Studio Code。主机是Windows 10。
似乎VSC for Linux Ubuntu为终端输出提供了一些默认的语法突出显示(至少我不记得我为此安装了任何扩展),如下所示:
如何将终端输出复制到 Microsoft Word/Outlook(在主机上)并保持这种颜色和格式?要复制终端输出,我只需使用右键单击鼠标
,然后复制
I am running Visual Studio Code on Linux Ubuntu (on virtual machine). The host machine is Windows 10.
Seems VSC for Linux Ubuntu offers some default syntax highlighting for terminal output (at least I do not remember that I have installed any extension for this), as follows:
How to copy terminal output to Microsoft Word/Outlook (on host machine) keeping this colourization and formatting? To copy terminal output I am just using right click mouse
and then Copy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 v1.66 中,请参阅发行说明
但是实际的命令是:
您必须先选择所需的文本,然后触发命令。
默认未绑定,命令为
workbench.action.terminal.copySelectionAsHtml
。您还可以右键单击并选择
复制为 HTML
。In v1.66, see the release notes
BUT the actual command is:
You have to select your desired text first and then trigger the command.
It is unbound by default, the command is
workbench.action.terminal.copySelectionAsHtml
.You can also right-click and choose
Copy as HTML
.这是一个较晚的答案,但我也为此而苦苦挣扎,只是解决了答案。
首先,您需要将此设置
editor.pasteas.enabled
设置为true。第二个选择终端中的文本,然后右键单击 - >
将其复制为HTML
。第三,您需要使用命令
粘贴为...
,默认情况下只能从命令调色板中获得。This is a late answer but I too have struggled with this and only just worked out the answer.
First you need to set this setting
editor.pasteAs.enabled
to true.Second select text in the terminal and right click ->
Copy as HTML
.Third you need to use the command
Paste As ...
which is only available from the command palette by default.