Visual studio code run code не работает
The text was updated successfully, but these errors were encountered:
johnnyPescarul commented Jun 15, 2016
@bpasero Sorry for the late reply, I didn't see the notification. I tried running "code --verbose" from command line and still nothing, not even one line. As soon as I connect to the internet, it works. I tried re-installing multiple times but I have the same behavior. I tried to replicate on a Windows 7 machine, but was not able to (so it seems to be limited to my Windows 8 machine).
bpasero commented Jun 15, 2016
@johnnyPescarul does it return immediately when running "code --verbose"?
johnnyPescarul commented Jun 15, 2016
@bpasero when I run it, it starts the process but it then hangs. It must be something early on since nothing is displayed with verbose flag on. Are there any logs generated?
bpasero commented Jun 15, 2016
@johnnyPescarul any chance you could find out all the processes that we are able to spawn? this might get us closer to see where it hangs.
@joaomoreno could this be an issue with creating a connection to the shared process if you are offline?
joaomoreno commented Jun 15, 2016
@bpasero Why the shared process? The window doesn't even seem to open.
bpasero commented Jun 15, 2016
@joaomoreno the shared process (to my understanding) gets created from the main side. we have seen super funky behaviour when sending telemetry where the entire VM stops in some DNS lookup. Maybe the main side stops in a similar situation trying to establish a connection to the shared process.
joaomoreno commented Jun 15, 2016 •
johnnyPescarul commented Jun 15, 2016
I tried again to see if any processes are actually started, but no VSCode process is being started at all, when trying to start in offline mode. Unfortunately I don't have another Windows 8 machine to try and see if I can replicate the issue.
bpasero commented Jun 16, 2016
@johnnyPescarul can you run code --version and see output?
johnnyPescarul commented Jun 16, 2016
@bpasero it is version 1.2.0
Again, if the laptop is offline, the code --version doesn't even work (nothing is displayed).
bpasero commented Jun 16, 2016
Wow, that seems to indicate a problem with Electron unless I am mistaken because we use Electron as node, correct @joaomoreno @Tyriar ?
Tyriar commented Jun 16, 2016
code --version is one of the first things that is checked. Literally the CLI process parses args and checks help and version in an ELectron process where ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 .
Which calls into cli.ts:
bpasero added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jun 17, 2016
ghost commented Jun 21, 2016
I have noticed this problem as well. Opening two visual studio code instances by running code --verbose twice has resulted in the second instance opening/starting correctly.
PHeonix25 commented Jul 11, 2016
Can confirm this exact same behaviour when running on Windows 10.
Putting my laptop in flight mode (as I was on a plane) meant that none of the processes were able to spawn. This means the issue is easily reproducible for me.
Running code --version or code --help while offline returns immediately without any processes spawning:
Running either command as soon as I was tethered back on solid ground was fine:
bpasero commented Jul 11, 2016
Can you try to see if a bare Electron app starts at least? Try with:
PHeonix25 commented Jul 11, 2016 •
I can confirm the same behaviour with the Electron app itself; both versions exhibited the same behaviour.
For reference, I downloaded the following two packages and just tried running electron.exe from a PS window (most similar example I could make to the reported behaviour above):
- electron-v1.2.6-win32-x64 (latest Win x64 binary)
- electron-v0.37.6-win32-x64 (Win x64 binary)
Thanks for helping me/us narrow it down so quickly!
Shall we make an issue on electron? I couldn't find anything in their issues list so far.
UPDATE: I found the following issue on the Atom Shell forum.
For the moment, might it be worth adding something to the VS Code project documentation so that we don't surprise/disappoint more people trying to use the editor without an internet connection?
bpasero commented Jul 11, 2016
PHeonix25 commented Jul 11, 2016
Will do, thanks @bpasero.
FYI - after finding this issue on the Atom Shell feedback forum, I also tried to implement one of the final proposed solutions: add the executable to the Windows Firewall rules - with no success - it's definitely a problem with electron. 😢
bpasero commented Jul 11, 2016
Thanks for filing it 👍
johnnyPescarul commented Jul 11, 2016
Finally, somebody was able to replicate the issue :) Thanks @PHeonix25 . For me this was a very big issue, because I had set-up a travel laptop with my dev environment, tested everything and was relying on doing a lot of offline work on that laptop. Unfortunately when I tried to use it offline I realized it was not working, and at that time I had no option to connect and download a different IDE. Thanks anyway for the great work on VSC.
PHeonix25 commented Jul 12, 2016
No worries @johnnyPescarul - keep an eye on the other issue for updates.
I was in the same situation - and it was a very frustrating 14hr flight.
Lyssimachia commented Jan 19, 2019
I'm experiencing the issue as well.
Windows 10 Home 1809 10.0.17763, VS Code 1.30.2
chriskn commented Jan 20, 2019
Same for me. I like VSCode but this bug is really annoying.
kellach commented Jan 21, 2019
Same for me,feel so bad
DamianSuess commented Jan 21, 2019 •
BOOO! NP++ to the rescue
VS Code version
itaishopen commented Jan 22, 2019
BOOO! NP++ to the rescue
VS Code version
same problem here with the exact same resolute
Emilius449 commented Jan 22, 2019
DamianSuess commented Jan 22, 2019
@Emilius449 Thank you for posting the workaround. I would prefer that they just fix it.
aditya305 commented Jan 24, 2019
Recently i just update my windows 10 to latest insider build 18290 and i see that VS code is working offline on this version so when windows 10 stable version of build will release it'll solve all the problems.
bpasero commented Jan 25, 2019
vikram-rawat commented Jan 25, 2019
I have the same problem I thought something is wrong then I looked into google and it turns out there are many people facing the exact same issue. Please fix it ASAP.
It has been happening for a month now. Before coming to this thread I was seariously looking for alternatives. Please fix it
ManalLiaquat commented Jan 29, 2019
I think it is the best time to switch to another editor 😡 😡 😡
joedf commented Jan 31, 2019 •
Experienced this just yesterday.
PinkiePieStyle commented Feb 4, 2019 •
My vscode wasn't starting when offline in 2017 and few weeks ago again.
Had same "dns.js:246 this._handle = new ChannelWrap();" crap
Connected to Internet and started vscode and disconnected was fine but then even debugging wasnt working without connection. Reinstalling, deleting Extensions, nothing helped. So i've switched to InsidersBuild wich was working.
Last week i was looking what is eating up all my ssd space and found an directory from code.
VSCode wasnt working anyway so ive deleted anything in these Folders.
C:\Users\xxx\AppData\Roaming\Code\Cache
C:\Users\xxx\AppData\Roaming\Code\CachedData
C:\Users\xxx\AppData\Roaming\Code\CachedExtensions
After starting vscode by mistake and not insiders it started fine without Internet.
Its working now since few Days so ive switched back from Insiders
lubrogit commented Feb 4, 2019
@PinkiePieStyle
You got it. Deleting content of the three directories worked for me. Nevertheless I recommend to make a copy. One never knows what may go wrong. Remember Murphy's laws .
Добрый день. Установил VS Code и попробовал запустить простой c++ с помощью code runner, но получил краказябры в ответ.
Как решить данную проблему?
- Вопрос задан более трёх лет назад
- 1701 просмотр
Простой 2 комментария
Вы пытаетесь выполнить код на c++ с помощью интерпретатора питона. Думаю code runner действует исходя из расширения файла и его стоит поменять с .py на .cpp например.
VS code это умный текстовый редактор. Он может только запускать сторонние программы для сборки вашего кода, но не собирать его самостоятельно. Так делать можно, но сложно. В вашем случае он пытается запустить python, а это другой язык программирования.
Проще всего для Win использовать Visual Studio Community.
Я просто переключил на другой файл, скрин поменял.
Я использую code runner чтобы запустить c++, но видимо в PATH нету пути к компилятору
Proshka17, Да, причину вы поняли правильно. g++ это компилятор, который он пытается запустить. Его можно установить как часть mingw. Можно попытаться заставить его работать.
Visual Studio Community содержит в себе другой интегрированный компилятор + отладчик и еще много всего. Она тоже бесплатная и скорее всего будет работать без дополнительной настройки.
tsarevfs, в разделе посвященном code runner написано:
Make sure the executor PATH of each language is set in the environment variable. You could also add entry into code-runner.executorMap to set the executor PATH. e.g. To set the executor PATH for ruby, php and html:
"code-runner.executorMap": "javascript": "node",
"php": "C:\\php\\php.exe",
"python": "python",
"perl": "perl",
"ruby": "C:\\Ruby23-x64\\bin\\ruby.exe",
"go": "go run",
"html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\"",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
>
>
Вот только я не знаю куда это вставить
Proshka17, file->preferences->extensions->code runner скорее всего. Туда нужно задать путь до g++ . Но он не устанавливается автоматически. Нужно установить MinGW. Возможно он сам добавит в PATH все что нужно.
I just installed VSCode recently (v1.26.1) on MacOS 10.13.6 and added code-runner. I tried it on a Python file and nothing happened upon executing "Run Code", either with anything selected or not. I then tried to choose Run Custom Command (the default one) and got this notification:
The Output window is completely empty.
I've tried to uninstall and reinstall, and also restart my computer.
The text was updated successfully, but these errors were encountered:
linhtto commented Aug 28, 2018
For me it doesn't work at all. If I try to run Python, for example, nothing happens and the OUTPUT window is empty. I tried to run the custom command in both ways, using the default keybinding ctrl + option + K and the Command Palette, I get the same popup notification. The difference is that the symbol on the notification is a red cross error sign if I run with the Command Palette, and a yellow warning sign if I run with the shortcut.
I already tried to disable all other extensions except this one to see if it makes a difference, but it doesn't. Basically I've never been able to get Code Runner to work at all.
formulahendry commented Aug 29, 2018
@linhtto Please delete the C:\Users\***\.vscode\extensions\formulahendry.code-runner-*** folder and install extension again.
linhtto commented Aug 29, 2018 •
@formulahendry , I use Mac, so the folder is in ~/.vscode/extensions. I deleted and reinstalled. But the same thing happens, I can't run anything. It doesn't matter if I turn on or off runInTerminal either.
formulahendry commented Aug 29, 2018
How about Run Code command?
linhtto commented Aug 29, 2018 •
It doesn't do anything at all. There's no notification, but the Terminal/Output are just empty and there's no sign of anything running.
formulahendry commented Aug 29, 2018
Could you try VS Code Insider?
linhtto commented Aug 29, 2018
I just installed a fresh VS Code Insider and then Code Runner. And with this it works. I'm very confused about this.
linhtto commented Aug 29, 2018
I reinstalled all my other packages (not too many and mostly standard ones), and it still works with VS Code Insider, but not VS Code the latest version 1.26.1 on MacOS 10.13.6.
formulahendry commented Aug 29, 2018
It may be the issue of VS Code, not this extension. So closing it.
linhtto commented Aug 29, 2018 •
I think I figured it out so I'll just document here in case it happens to others. Previously I installed some small extensions to run specific programs before I stumbled upon code runner which is much more comprehensive. I set the same key binding for them since I want to run everything with the same command. I uninstalled the other extensions but somehow code runner still didn't work. I just realized those extensions still lived in ~/.vscode/extensions even though vscode itself didn't list them anymore. Removing these obsolete folders did the trick. Code runner now works on the stable vscode release as well.
falconhurst commented Sep 8, 2019
Turns out I had a similar issue:
Microsoft One Note uses ctrl+alt+n, so if you have that open Code-runner won't go
glowdan commented Apr 27, 2020
I encountered the same problem.
But just empty the ~/.vscode folder do not help me.
At last, I realize that may be the cause of the cache. So I cleaned the folder of "$HOME/Library/Application\ Support/Code"
Yeah the code runner is working again.
odmoralesb commented Aug 13, 2020 •
I updated VS Code and solved it
jaynj908 commented Nov 4, 2020
I went to accounts/user(GITHUB) -Manage Trusted Extensions, typed code-runner in the command pallette and another instance of VS Code opened. I opened a Python file and tried CTR+ALT+N and it worked? I was troubleshooting most of the day and just tried a random thing. Is there a hotkey for permissions that I might have hit?
SerbanNabres commented Nov 7, 2020
how can i fix this with code runner
[Running] python -u "c:\Users\Serban\classes.py"
main.Dog object at 0x000002C32DBC7D00>
[Done] exited with code=0 in 0.169 seconds
tbouchik commented Feb 8, 2022 •
Updating VSCode solved it for me
jaynj908 commented Feb 10, 2022
I did manage to fix it but sorry too much time has passed and I do not remember how I fixed it or if it was on my Linux or Windows machine. But I have been using ever since and have no issues
One day, I open my vscode but find that the code cannot run any more, and I got a error "command 'code-runner.run' not found".
The text was updated successfully, but these errors were encountered:
Yeba commented Mar 15, 2018
thanks,now it runs well.
formulahendry commented Mar 18, 2018
VeselinAtanasov commented Nov 13, 2018 •
altimmons commented Dec 9, 2018
Having the same issue. Tried Reinstall. I can find no reference to this.
cwest28 commented Mar 30, 2019
I am experiencing the same issue as well, after reinstall. Any updates?
cwest28 commented Mar 30, 2019
update: Solution found in another thread
Please delete the C:\Users*.vscode\extensions\formulahendry.code-runner-* folder and install extension again.
itsmasud commented Apr 5, 2019
update: Solution found in another thread
Please delete the C:\Users***.vscode\extensions\formulahendry.code-runner-*** folder and install extension again.
Not working though.
GuoweiYang19891101 commented Apr 11, 2019
Same issue here. Any update?
zlzzq commented Jun 2, 2019
I have the same problem.-19-6-1
KimberlyZou commented Jun 3, 2019
I have same issue,have any solution to deal with it?
zlzzq commented Jun 3, 2019
I delete all of my extension and downland the latest version of VsCode, then cover the last version file. It works well now, but I don't know why.
juntaosun commented Jun 4, 2019
发生这个问题的原因是micromatch引起的,
请尝试打开formulahendry.code-runner-0.9.10/out/src/codeManager.js
把以下位置的代码注释掉,禁用micromatch。保存然后重新打开编辑器。问题解决!
line 12:
//const micromatch = require("micromatch");
/* if (executor == null) const executorMapByGlob = this._config.get("executorMapByGlob");
if (executorMapByGlob) const fileBasename = path_1.basename(this._document.fileName);
for (const glob of Object.keys(executorMapByGlob)) if (micromatch.isMatch(fileBasename, glob)) executor = executorMapByGlob[glob];
break;
>
>
>
> */
csunny commented Jun 4, 2019
@juntaosun I comment those code, and it works well, thanks !
CimXin commented Jun 5, 2019
Craig-Cheng commented Jun 6, 2019
发生这个问题的原因是micromatch引起的,
请尝试打开formulahendry.code-runner-0.9.10/out/src/codeManager.js
把以下位置的代码注释掉,禁用micromatch。保存然后重新打开编辑器。问题解决!line 12:
//const micromatch = require("micromatch");line 225~236:
/* if (executor == null) const executorMapByGlob = this._config.get("executorMapByGlob");
if (executorMapByGlob) const fileBasename = path_1.basename(this._document.fileName);
for (const glob of Object.keys(executorMapByGlob)) if (micromatch.isMatch(fileBasename, glob)) executor = executorMapByGlob[glob];
break;
>
>
>
> */
phith0n commented Jun 8, 2019
发生这个问题的原因是micromatch引起的,
请尝试打开formulahendry.code-runner-0.9.10/out/src/codeManager.js
把以下位置的代码注释掉,禁用micromatch。保存然后重新打开编辑器。问题解决!line 12:
//const micromatch = require("micromatch");line 225~236:
/* if (executor == null) const executorMapByGlob = this._config.get("executorMapByGlob");
if (executorMapByGlob) const fileBasename = path_1.basename(this._document.fileName);
for (const glob of Object.keys(executorMapByGlob)) if (micromatch.isMatch(fileBasename, glob)) executor = executorMapByGlob[glob];
break;
>
>
>
> */
Thanks a million, works again.
formulahendry commented Jun 8, 2019
@juntaosun That's interesting.. How do you find it is the problem of micromatch?
Suriya1994 commented Jun 12, 2019
发生这个问题的原因是micromatch引起的,
请尝试打开formulahendry.code-runner-0.9.10/out/src/codeManager.js
把以下位置的代码注释掉,禁用micromatch。保存然后重新打开编辑器。问题解决!
line 12:
//const micromatch = require("micromatch");
line 225~236:
/* if (executor == null) const executorMapByGlob = this._config.get("executorMapByGlob");
if (executorMapByGlob) const fileBasename = path_1.basename(this._document.fileName);
for (const glob of Object.keys(executorMapByGlob)) if (micromatch.isMatch(fileBasename, glob)) executor = executorMapByGlob[glob];
break;
>
>
>
> */
This Worked!! Thansk a Lot.
atulkumar323 commented Jun 27, 2019
Hi All,
I am having code runner issue as well.
Apologies for asking dumb question but where do you run above code to fix the issue.
Thanks
azhar2ds commented Jul 3, 2019
Hi,
Got the same issue. my visual studio was working fine. I was able to run my code and everything was running perfect. .But the moment i came back from my break i got this issue now. What would be the root cause of this issue? and how do we fix it?
Appreaciate your suggestions.
Thanks alot.
b-rtn commented Jul 12, 2019
bozhouyongqi commented Jul 18, 2019
it works for me, thanks for @juntaosun
ghost commented Jul 20, 2019
same error and I did this:
发生这个问题的原因是micromatch引起的,
请尝试打开formulahendry.code-runner-0.9.10/out/src/codeManager.js
把以下位置的代码注释掉,禁用micromatch。保存然后重新打开编辑器。问题解决!
line 12:
//const micromatch = require("micromatch");
line 225~236:
/* if (executor == null) const executorMapByGlob = this._config.get("executorMapByGlob");
if (executorMapByGlob) const fileBasename = path_1.basename(this._document.fileName);
for (const glob of Object.keys(executorMapByGlob)) if (micromatch.isMatch(fileBasename, glob)) executor = executorMapByGlob[glob];
break;
>
>
>
> */
I don't get the error anymore but it is not running when i push the run button.
Any suggestions?
ghost commented Jul 20, 2019
This error appears:
Extension host terminated unexpectedly.
singhrajgithub commented Aug 13, 2019
@Bernt-jan @azhar2ds, Are you able to resolve this issue mate? I am also facing this issue from past few days. Reinstallation did not help me.
ghost commented Aug 13, 2019
I delete all my extentions and reinstal it, that was working for me
singhrajgithub commented Aug 13, 2019
@Bernt-jan, Let me try the same process.
singhrajgithub commented Aug 13, 2019
@Bernt-jan, Thanks it has worked for me.
Antnee commented Sep 3, 2019
Fresh install of VSCode today, the only extension is this, and we have this problem when trying to execute Python. I've patched the file which fixes the issue. Weirdly I'm getting v0.9.10, but the marketplace says that we should be on v0.9.14? I've tried to install that version from a VSIX but it doesn't work, and keeps asking me to reload the editor.
In the end I've just gone back to v0.9.10 amd patched the file as others have above.
scott-x commented Oct 6, 2019
I am facing the same issue, just looked at the replies, seems for windows platform. Is there any solution for Macos?
RoseRiyadh commented Oct 19, 2019
I have this problem .. first it was java and python .. I installed A LOT of java extensions and it worked .. now python 😭
singhrajgithub commented Oct 19, 2019
@rosecollins , this issue is already closed. In my opinion, you would need to do the same for python what you did for java.
Are you using any extension for python?
RoseRiyadh commented Oct 19, 2019
@rosecollins , this issue is already closed. In my opinion, you would need to do the same for python what you did for java.
Are you using any extension for python?
Whenever I close the program and re-open it .. it stops .. now even when extensions are installed .. the runner is not working .. :(
On Oct 19, 2019, at 11:12 AM, rosecollins ***@***.***> wrote: @rosecollins , this issue is already closed. In my opinion, you would need to do the same for python what you did for java. Are you using any extension for python? Whenever I close the program and re-open it .. it stops .. now even when extensions are installed .. the runner is not working .. :( — You are receiving this because you commented. Reply to this email directly, view it on GitHub , or unsubscribe .
edvilme commented Feb 19, 2020
Having the same issue, is there any fix? Tried everything in this thread with no result :(
cwest28 commented Mar 29, 2020
I did the same as KimAdrian and it also got mine working as it should.
It makes me think truly uninstalling the extension (deleting it and all associated files in xxxx/AppData/xxxx is what actually fixed it.
If you do not know how to do this, there are plenty of help threads out there.
pritishmishra703 commented Apr 9, 2020
Hey,
Having the same Issue. I have tried all the things mentioned above. Tried Re-installing the Extension and Re-installing the Whole Visual Studio Code but nothing worked for me
Can anybody Help PLEASE .
abhinav285 commented Sep 5, 2020
I tried every solutopn listed here but it still didnt work.
markushkc commented Sep 7, 2020
I discovered what my problem was:
I was running my JS code with F8 (Node.js Exec extension), and trying to stop the execution with ctrl + alt + M (Code runner extension). Disabled Node.js Exec extension and now it works perfectly.
Moses-dot1 commented Sep 17, 2020
Was experiencing the same issues I just restarted my vs code and it works my code is running
pritishmishra703 commented Oct 1, 2020 •
If Anyone is Reading this and still the Problem persists then probably your AntiVirus Software is creating this issue !! In my Case, Quick Heal was Quarantining my one of the files (This was one of the Code Runner Extension File) and as soon as I removed it from my Quarantined files all was working fine. Should try!
Tejas21-design commented Feb 28, 2021
If you had runned it many times and after so many days it shows such type of error then you must close the Vscode then open it again and then try running ,it will run well. (if then also error shows then uninstall the code runner extension and then install it then close Vscode and open it again the error will be fixed.)
Tejas21-design commented Feb 28, 2021
If Anyone is Reading this and still the Problem persists then probably your AntiVirus Software is creating this issue !! In my Case, Quick Heal was Quarantining my one of the files (This was one of the Code Runner Extension File) and as soon as I removed it from my Quarantined files all was working fine. Should try!
Vinintheskies commented Mar 3, 2021 •
update: Solution found in another thread
Please delete the C:\Users***.vscode\extensions\formulahendry.code-runner-*** folder and install extension again.
Thats works here, thanks
etherRAWRR commented Mar 13, 2021
发生这个问题的原因是micromatch引起的,
请尝试打开formulahendry.code-runner-0.9.10/out/src/codeManager.js
把以下位置的代码注释掉,禁用micromatch。保存然后重新打开编辑器。问题解决!
line 12:
//const micromatch = require("micromatch");
/* if (executor == null) const executorMapByGlob = this._config.get("executorMapByGlob");
if (executorMapByGlob) const fileBasename = path_1.basename(this._document.fileName);
for (const glob of Object.keys(executorMapByGlob)) if (micromatch.isMatch(fileBasename, glob)) executor = executorMapByGlob[glob];
break;
>
>
>
> */发生这个问题的原因是micromatch引起的,
请尝试打开formulahendry.code-runner-0.9.10/out/src/codeManager.js
把以下位置的代码注释掉,禁用micromatch。保存然后重新打开编辑器。问题解决!
line 12:
//const micromatch = require("micromatch");
/* if (executor == null) const executorMapByGlob = this._config.get("executorMapByGlob");
if (executorMapByGlob) const fileBasename = path_1.basename(this._document.fileName);
for (const glob of Object.keys(executorMapByGlob)) if (micromatch.isMatch(fileBasename, glob)) executor = executorMapByGlob[glob];
break;
>
>
>
> */
To start, we'd like to say we're sorry that you're here reading this document instead of having a good time using the Integrated Terminal in Visual Studio Code. The VS Code team works hard to make the terminal experience as seamless as possible but in some cases, there are issues with shell or terminal configurations that the VS Code editor can't work around.
After having worked with hundreds of developers to diagnose their terminal launch failures, the VS Code team has put together this topic with the advice and troubleshooting tips that have helped people in the past. We hope you'll find an answer here for your shell or terminal issue and can get quickly back to work.
Integrated Terminal user guide
If you are new to using the VS Code Integrated Terminal, you can learn more in the Integrated Terminal user guide. There you can read how to configure the terminal, as well as review answers to common questions.
Below are specific troubleshooting steps, if the user guide hasn't helped you diagnose the launch failure. The troubleshooting steps, such as checking your settings and enabling logging, apply to all platforms that support VS Code; macOS, Linux, and Windows.
Note: If you're on Windows, you may want to review the common issues on Windows section first.
Troubleshooting steps
To troubleshoot Integrated Terminal launch failures in Visual Studio Code, follow these steps to diagnose issues:
Check your user settings. Review these terminal.integrated settings that could affect the launch:
- terminal.integrated.shell. - The path of the shell that the terminal uses.
- terminal.integrated.shellArgs. - The command-line arguments when launching the shell process.
- terminal.integrated.cwd - The current working directory (cwd) for the shell process.
- terminal.integrated.env. - Environment variables that will be added to the shell process.
- terminal.integrated.inheritEnv - Whether new shells should inherit their environment from VS Code.
- terminal.integrated.automationShell. - Shell path for automation-related terminal usage like tasks and debug.
- terminal.integrated.splitCwd - Controls the current working directory a split terminal starts with.
- terminal.integrated.windowsEnableConpty - Whether to use ConPTY for Windows terminal process communication.
You can review settings in the Settings editor (File > Preferences > Settings) and search for specific settings by the setting ID.
A quick way to check if you have changed settings that you might not be aware of, is to use the @modified filter in the Settings editor.
Most Integrated Terminal settings will need to be modified directly in your user settings.json JSON file. You can open settings.json via the Edit in settings.json link in the Settings editor or with the Preferences: Open Settings (JSON) command from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ).
Test your shell directly. 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. The exit codes displayed come from the shell and you may be able to diagnose shell issues by searching on the internet for the specific shell and exit code.
Use the most recent version of VS Code. Each VS Code monthly release has many updates and fixes and may include integrated terminal improvements. You can check your VS Code version via Help > About (on macOS Code > About Visual Studio Code). To find the latest version of VS Code, go to the VS Code release notes. You may also want to check that you have installed the latest version of your shell.
Use the most recent version of your shell. If your shell is installed separate from your platform, try installing the latest available version of the shell. The same advice applies if you are on an older build of your operating system. For example, some older versions of Windows 10 did not work well with the VS Code terminal.
Enable trace logging. You can enable trace logging and capture a log when launching the terminal. Logging often reveals what is wrong as all arguments used to create the terminal process/pty are recorded. Bad shell names, arguments, or environment variables can cause the terminal to not launch. Keep this log for later if your problem isn't solved.
Additional troubleshooting steps
If none of these steps helped solve the issue, you can also try:
- Ask about it on Stack Overflow, often launch issues are related to environment setup and not a problem with VS Code.
- If the terminal is being launched from an extension, report the issue to the extension by opening the issue reporter (Help > Report Issue) and set File On = "An Extension"
- If you believe it to be a bug with VS Code, report the issue using the issue reporter (Help >Report Issue). The issue reporter will autofill relevant information, see Creating great terminal issues for what else to include in the report.
- If you're on Windows 10 1809 (build 17763) or below, the issue is related to the legacy "winpty" backend. Upgrading to Windows 1903 (build 18362) will move you onto the new "conpty" backend that is built by Microsoft and could fix your problem.
Exit codes
The exit codes displayed in the terminal launch failure notification are returned from the shell process and are not generated by VS Code. There are many available shells that can be used in the terminal and hundreds of possible exit codes.
Common issues on Windows
Make sure compatibility mode is disabled
When upgrading to Windows 10, some apps may have compatibility mode turned on automatically. When this happens with VS Code, the terminal breaks as it does some low level things to enable the emulation it uses. You can check and disable compatibility mode by right-clicking on the VS Code executable and selecting properties, then uncheck the Run this program in compatibility mode option in the compatibility tab.
The terminal exited with code 1 on Windows 10 (with WSL as the default shell)
This can happen if Windows Subsystem for Linux (WSL) is not set up with a valid default Linux distribution.
Note: 'docker-desktop-data' is not a valid distribution.
- Open PowerShell and enter wslconfig.exe /l to confirm WSL is installed correctly and list the currently available Linux distributions within your system. Confirm a valid distribution has (default) next to it.
- To change the default distribution, enter wslconfig.exe /setdefault "distributionNameAsShownInList"
The terminal not working when running the 32-bit Windows client on 64-bit Windows?
The easy fix for this issue is to use the 64-bit version. If you must use the 32-bit version, you need to use the sysnative path when configuring your shell path instead of System32. Adding this setting should fix the issue:
A native exception occurred
Typically this error occurs due to anti-virus software intercepting and blocking the winpty/conpty components from creating the terminal process. To work around this error, you can exclude the following file from your anti-virus scanning:
Reporting this issue to the Anti-virus team can also help stamp out the issue all together.
Terminal exits with code 3221225786 (or similar)
This can happen when you have legacy console mode enabled in conhost's properties. To change this, open cmd.exe from the start menu, right-click the title bar, go to Properties and under the Options tab, uncheck Use legacy console.
Читайте также: