Visual Studio Code - Terminal Blank Screen

余生长醉 提交于 2020-07-02 06:00:07

问题


I've been using Visual Studio Code since it was in beta and one of the features I like best about it is the integrated terminal for using the Angular CLI in app. I've had it working fine since I had the laptop, but I re-installed Windows 10 over the Xmas break and obviously as a result had to re-install Visual Studio Code.

Since then I've had issues with the Terminal, it's blank until you hit return, at which point you see the path, but not the usual copyright notice you should get from the Windows Command Line.

Before hitting return:

After hitting return:

And this is what I was expecting directly from the Windows 10 Command Line:

So far I've tried the following:

  • The usual Windows shut down / restart
  • Re-installing VS Code (even changed from regular to insiders)
  • Changing the default Command Line Shell from CMD to Powershell and back again
  • Adding a new Command Line Shell

Is there anything else I can try? Has anyone else encountered the same issue?


回答1:


My solution for VSCode 1.39.2 with Ubuntu has been:

File -> Preferences -> Setting -> Features -> Terminal -> Inherit Env




回答2:


I have the same problem with PowerShell even after installing the 1.32.1 update. I fixed it by going to PowerShell options and checked the "Use legacy console" option and now it works as it should and I thinks it should work with cmd too.




回答3:


After some research I've found that this is a bug in VS Code with the application they use to integrate the shell. Looks like Android Studio has the same issue too. You can read about the more specific how / when / what etc. here:

https://github.com/Microsoft/vscode/issues/57803

This has been fixed on the insiders release that landed for me today (08/01/2019), not sure when this will be rolled out to the general release (if not January then I would imagine it might roll out in February barring no further issues).

So for anyone else still getting this issue, update to the latest version of VS Code. If you have done and you're still getting the same problem you can check and report issues here:

https://github.com/Microsoft/vscode/issues




回答4:


Here is the fix:

1) CLick bottom left setting wheel 2) go to setting > Features > terminal 3) Select Explorer kind: Intergrated 5) Change inheritEnv to true.




回答5:


I have the same problem with PowerShell, Gitbash, etc. with code version 1.36.0. See Version info 1

I could clear the problem with the following steps:

  • Open PowerShell in admin Mode. 2

  • At the bottom of the item Legacy console is a checkbox, which is selected by default.

  • Deselect this option then Save. 3

  • Reboot Code Finally, the console appears as expected. 4




回答6:


Inside the terminal window, Press Ctrl + c and hit enter

Though it's not a permanent solution but its a quick fix to get the juice flowing while you are working with VSCode




回答7:


I had the same problem in visual studio code 1.41.1 in ubuntu 18.04,I solved it by editing the settings.json by going through settings and search for 'Inherit Env'and opening Edit in settings.json and changing

"terminal.integrated.inheritEnv": true,The screenshot is provided in the link below




回答8:


Remove the following line in settings.json file

terminal.integrated.inheritEnv": false,

You can locate settings.json file in the following locations —

  • Windows %APPDATA%\Code\User\settings.json
  • macOS $HOME/Library/Application Support/Code/User/settings.json
  • Linux $HOME/.config/Code/User/settings.json



回答9:


I had the same problem while working on CMD in my VSCode. I fixed it by going to the Terminal Menu in the VS Code and selected New Terminal. And a new cmd terminal opened up and it working just fine.




回答10:


VS Code prompted a dialog at bottom right corner recommending me to switch the RenderType option to dom, because it felt it was running slow. Then the blank-terminal issued was gone. My environment was a vm of Ubuntu 16.04 running on win10.




回答11:


Same issue occurred for me and I browsed through the VS Code issues on GitHub. Here is the solution I found: https://github.com/microsoft/vscode/issues/53782#issuecomment-414919965

Change terminal.integrated.rendererType back to canvas in VS Code settings and issue does not reappear.




回答12:


The solution for me was to uninstall the user mode and instead install system mode. This is what Jenuel Ganawed stated and I don't know why that post is downvoted. It solves the issue in my case.




回答13:


Here is the fix for Code in Ubuntu-18.04 : The issue doesn't appear when opened through the terminal. Go to the settings in the bottom left and search for "terminal.integrated.inheritEnv". Check the box for this in user section that way terminal will inherit user's environment. Done!!




回答14:


This is the only thing that worked for me.

Change this configuration:

File -> Preferences -> Settings, search for terminal.explorerKind, edit to external

or just edit the json file

"terminal.explorerKind": "external"

When VSCode prompted me telling me that using integrated was better, I followed its advice and switched. But a couple of days ago it started being very weird, in that it left a space between the actual prompt and whatever I was writing, like this: Sometimes the spacing left was of more than a dozen lines. It got instantaneously fixed once I switched back to external.

PS: This was also the case with Microsoft's Powershell terminal. I don't know if other terminals have the same issue under Windows.




回答15:


I was experiencing the same issue. I upgraded to the latest version of VSCode 1.42.1, but that didn't resolve it. It seems that the issue has to do with Powershell 2.0, so I removed it:

Control Panel->Programs and Features->Turn Windows features on or off->Windows PowerShell 2.0 (disable it).

This resolved the issue for me.



来源:https://stackoverflow.com/questions/54092486/visual-studio-code-terminal-blank-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!