[软件设计/软件工程] Visual Studio Code - 终端 (PowerShell) - 如何复制文本

[复制链接]
发表于 2022-5-4 09:08:17
问题
如何在终端中复制文本?

(我试过 Ctrl+C,但会在终端中产生 ^C。右键单击似乎可以粘贴剪贴板中的任何内容。)

“terminal.integrated.rightClickCopyPaste”:true - 覆盖为 false

回答
我不知道您使用的是哪个版本的 Visual Studio Code,但这个用户设置已经存在了一段时间(也许一年;我可能错了):
  1. // A set of command IDs whose keybindings will not be sent to the shell and instead always be handled by Code. This allows the use of keybindings that would normally be consumed by the shell to act the same as when the terminal is not focused, for example Ctrl + P to launch Quick Open.
  2.   "terminal.integrated.commandsToSkipShell": [

  3.      "workbench.action.terminal.copySelection",
  4.      "workbench.action.terminal.paste",
  5.   ],
复制代码

里面还有很多命令。我只是展示你感兴趣的东西。默认情况下,这些复制/粘贴命令已经存在。

如果我禁用 copySelection 命令,我会得到您所看到的行为。因此,您可能需要将 Visual Studio Code 更新到新版本,或者确保上述设置确实出现在您的用户设置中。正如我所说,这对我来说是默认设置,但也许对你来说有些变化。

[2018 年 2 月编辑]:

Visual Studio Code 1.20 添加了设置以自动将您在终端中选择的任何内容复制到剪贴板。请参阅选择时复制。

因此,只需选择任何文本即可将其复制到剪贴板。





上一篇:快速向下滚动会使条项目消失
下一篇:如何修复无效请求(不支持的 SSL 请求)

使用道具 举报

Archiver|手机版|小黑屋|吾爱开源 |网站地图

Copyright 2011 - 2012 Lnqq.NET.All Rights Reserved( ICP备案粤ICP备14042591号-1粤ICP14042591号 )

关于本站 - 版权申明 - 侵删联系 - Ln Studio! - 广告联系

本站资源来自互联网,仅供用户测试使用,相关版权归原作者所有

快速回复 返回顶部 返回列表