Visual Studio Code 空白终端,无法输入/键入任何内容 [Windows 10]

itk*_*anz 6 windows terminal powershell visual-studio-code vscode-settings

我遇到了这个问题,我在 Visual Studio Code 上工作得很好,安装了一些扩展,然后我的终端被冻结(黑屏)。我无法在终端内输入任何内容。

下图显示了我的终端的外观:

非工作终端

我什至尝试卸载 VS Code(以及所有扩展)、更新 Windows,然后重新安装 VS Code 的新副本。但问题仍然存在。

我在其他线程中尝试了一些建议的方法使终端再次工作,但终端问题并没有消失。

我已经尝试过的一些建议解决方案是:

  • 重新安装 VS Code、更新和重新启动 VS Code 以及 Windows。
  • 将默认命令行 Shell 从 CMD 更改为 Powershell 和 git bash 并再次返回
  • 添加新的命令行 Shell
  • 调整终端窗口大小
  • 放大/缩小终端
  • 选中 Powershell 选项中的“使用旧控制台”选项
  • 更改将 inheritEnv 更改为 true 作为 "terminal.integrated.inheritEnv": true
  • 在终端窗口内,按下Ctrl + c并点击enter
  • 将 VS Code 形式中的资源管理器种类更改为继承到外部 "terminal.explorerKind": "external"
  • 将渲染器类型从autoDOMcanvas来回更改"terminal.integrated.rendererType": "canvas"

系统信息:

Windows 10,版本 1909

VS 代码信息:

版本:1.44.2(用户设置)

提交:ff915844119ce9485abfe8aa9076ec76b5300ddd

日期:2020-04-16T16:36:23.138Z

电子:7.1.11

铬:78.0.3904.130

Node.js:12.8.1

V8:7.8.279.23-electron.0

操作系统:Windows_NT x64 6.2.9200

输出code --log trace https : //justpaste.it/673hy

代码输出 --version

1.44.2

ff915844119ce9485abfe8aa9076ec76b5300ddd

x64

输出 code --status

Version:          Code 1.44.2 (ff915844119ce9485abfe8aa9076ec76b5300ddd, 2020-04-16T16:36:23.138Z)
OS Version:       Windows_NT x64 6.2.9200
CPUs:             Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz (4 x 2295)
Memory (System):  7.93GB (2.87GB free)
VM:               0%
Screen Reader:    no
Process Argv:     --log trace
GPU Status:       2d_canvas:                     enabled
                  flash_3d:                      enabled
                  flash_stage3d:                 enabled
                  flash_stage3d_baseline:        enabled
                  gpu_compositing:               enabled
                  multiple_raster_threads:       enabled_on
                  oop_rasterization:             disabled_off
                  protected_video_decode:        unavailable_off
                  rasterization:                 enabled
                  skia_renderer:                 disabled_off_ok
                  video_decode:                  enabled
                  viz_display_compositor:        enabled_on
                  viz_hit_test_surface_layer:    disabled_off_ok
                  webgl:                         enabled
                  webgl2:                        enabled

CPU %   Mem MB     PID  Process
    0      105   13036  code main
    0       84    9172     shared-process
    0       38    9916     utility
    0      213   11576     window (Settings - adv_exe_6 - Visual Studio Code)
    0       22    3760       winpty-process
    0        7    7652         console-window-host (Windows internal process)
    0        7    8760         C:\WINDOWS\System32\cmd.exe
    0       20    6228       winpty-process
    0        7     232         console-window-host (Windows internal process)
    0       44   10196         C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
    0       78    7988       extensionHost
    0       64    2840         electron_node tsserver.js
    0       35   10444           electron_node typingsInstaller.js typesMap.js
    0       60   13140         "C:\Users\ITKHAN\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\ITKHAN\AppD
ata\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-
ipc --clientProcessId=7988
    0       42   14272         electron_node tsserver.js
    0       22    9492       winpty-process
    0       68    5716         C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
    0        7    5724         console-window-host (Windows internal process)
    0       11   12124       watcherService
    0        7   14004         console-window-host (Windows internal process)
    0       22   13552       winpty-process
    0        7   10100         console-window-host (Windows internal process)
    0        7   11960         C:\WINDOWS\System32\cmd.exe
    0      143   13760     gpu-process
    0       15   14188     electron-crash-reporter

Workspace Stats:
|  Window (Settings - adv_exe_6 - Visual Studio Code)
|    Folder (adv_exe_6): 8 files
|      File types: js(4) stackdump(1) html(1) css(1)
|      Conf files:
Run Code Online (Sandbox Code Playgroud)

如果有人能帮助我调试这个问题,我将不胜感激。谢谢。

itk*_*anz 4

这是一个帮助我找到解决此问题的方法的视频。

取消选中VS Code 属性中的兼容模式,其中显示以兼容模式运行此程序:

但这使得每当我在 VS Code 中打开新终端时,终端都会在外部窗口中打开,而不是集成到 VS Code 中。

所以我还在 VS code 设置 > 终端 > Inegerated:Windows Enable Conpty 中禁用了 Conpty for Windows 终端

"terminal.integrated.windowsEnableConpty": false
Run Code Online (Sandbox Code Playgroud)

这里需要注意的有趣的一点是,当这个问题第一次出现时,这个解决方案对我不起作用。那时,我的 VS code 已经安装了所有扩展。更新 Windows 后,重新安装不带任何扩展的 VS code 的新副本,这个解决方案确实对我有用。

因此,根本问题可能与过时的 Windows 或我安装的某些扩展有关。