Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code blank terminal, can't enter/type anything [Windows 10]

I am facing this issue where I was working fine with Visual Studio Code, installed some extensions, and then my terminal is frozen (blank screen). I am not able to type anything inside terminal.

The image below shows how my terminal looks:

nonworking termina

I even tried uninstalling VS Code (as well as all the extensions), updated Windows, and then reinstalled the fresh copy of VS code. But the problem is still there.

I tried some suggested methods in other threads to make the terminal work again, but the terminal problem does not go away.

Some of the suggested solutions that I already tried are:

  • Re-installing VS Code, updating, and restarting VS Code as well as Windows.
  • Changing the default Command Line Shell from CMD to Powershell and git bash and back again
  • Adding a new Command Line Shell
  • Resizing the terminal window
  • Zoom In/Out of the terminal
  • checked the "Use legacy console" option in Powershell options
  • changed Change inheritEnv to true as "terminal.integrated.inheritEnv": true
  • Inside the terminal window, Pressed Ctrl + c and hit enter
  • changed the explorer kind in VS Code form inherited to external "terminal.explorerKind": "external"
  • changing the renderer type from auto to DOM, canvas forth and back "terminal.integrated.rendererType": "canvas"

System Info:

Windows 10, version 1909

VS Code Info:

Version: 1.44.2 (user setup)

Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd

Date: 2020-04-16T16:36:23.138Z

Electron: 7.1.11

Chrome: 78.0.3904.130

Node.js: 12.8.1

V8: 7.8.279.23-electron.0

OS: Windows_NT x64 6.2.9200

Output of code --log trace: https://justpaste.it/673hy

Output of code --version

1.44.2

ff915844119ce9485abfe8aa9076ec76b5300ddd

x64

Output of 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:

I would really appreciate if someone could help me in debugging this issue. Thanks.

like image 282
itkhanz Avatar asked May 02 '20 11:05

itkhanz


People also ask

Why can't I type in my terminal VS Code?

Run as Administrator Follow these steps to solve this problem: First of all, close VS Code. Now, right click on it and choose 'Run as administrator'. Then, open up the terminal and try typing/pasting.

How do I enable terminal code in Visual Studio?

To open the terminal: Use the Ctrl+` keyboard shortcut with the backtick character. Use the View > Terminal menu command. From the Command Palette (Ctrl+Shift+P), use the View: Toggle Terminal command.

Why does VS Code not take input?

Go to settings (ctrl+,) -> Search settings -> : Code-runner : Run in terminal - Check this and you will be able to run the code directly in the terminal which takes input. :) Show activity on this post. By default it remains unchecked.

Why is Visual Studio code not working?

Try uninstalling and reinstalling VS Code. If code is still not found, consult the platform-specific setup topics for Windows and Linux. On macOS, you need to manually run the Shell Command: Install 'code' command in PATH command (available through the Command Palette Ctrl+Shift+P).

How to fix terminal not working in Visual Studio Code?

I tried some suggested methods in other threads to make the terminal working again, but the terminal problem does not go away. Some of the solutions that I already tried are:- Re-installing VS Code, updating, and restarting VS Code as well as Windows.

How do I open a new terminal in Visual Studio Code?

Use the View > Terminal menu command. From the Command Palette ( Ctrl+Shift+P ), use the View: Toggle Terminal command. You can create a new terminal via the Terminal menu with Terminal > New Terminal. Note: Open an external terminal with the Ctrl+Shift+C keyboard shortcut if you prefer to work outside VS Code.

Why can’t Visual Studio Code open the side bar on Linux?

# Currently, the terminal consumes many key bindings, preventing Visual Studio Code from reacting to them. An example of this is Ctrl+B to open the Side Bar on Linux and Windows. This is necessary as various terminal programs and/or shells may respond to these key bindings themselves.

How do I troubleshoot Terminal Launch issues in VS Code?

Try running your designated integrated terminal shell outside VS Code from an external terminal or command prompt. Some terminal launch failures may be due to your shell installation and are not specific to VS Code.


2 Answers

Here's a video that helped me find a way to solve this issue.

I unchecked the compatibility mode in VS Code properties where it says Run this program in compatibility mode for:.

But this made the terminal open in an external window instead of being integrated in VS Code whenever I opened an new terminal inside VS Code.

So I also disabled the Conpty for Windows terminal inside VS code settings > Terminal > Inegrated:Windows Enable Conpty

"terminal.integrated.windowsEnableConpty": false

The interesting point to note here is that this solution didn't work for me when this problem first arose. At that time, I had my VS code with all the extensions installed. After updating Windows, reinstalling fresh copy of VS code without any extensions, this solution did do the trick for me.

So, the underlying issue was probably with the outdated Windows, or some extensions that I had installed.

like image 114
itkhanz Avatar answered Oct 20 '22 13:10

itkhanz


I switched off git.autorefresh in the settings. In VS code, go to file --> Preferences ---> settings and in the search bar type git.autorefresher; then, uncheck whether auto refreshing is enabled. under Git:Autorefresh:

enter image description here

This way worked for me.

like image 26
Yahya Avatar answered Oct 20 '22 13:10

Yahya