VSCode terminal not open (exit code : 3221225794) - visual-studio-code

When I open terminal in VSCode, i saw this error and not open terminal tab.
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" terminated with exit code: 3221225794.

These are the solutions I have found from my research
1st Option:
Run VS Code as aadministrator
2nd Option:
Configure terminal options/args for Powershell
3rd Option:
Please check the following link, this link provide some VS Code trouble shooting steps
https://code.visualstudio.com/docs/supporting/troubleshoot-terminal-launch
4th Option:
Use 'cmd.exe' instead of 'powershell.exe' by following these steps here: https://stackoverflow.com/a/59416769/2015398

Related

Why does VS Code Terminal terminate shortly after open with various error codes depending on terminal type?

My VS Code keeps shutting down the terminal. (30 s up to 5 min after I open it.) I've tried:
Reinstalling VS Code with deleting the folders %APPDATA%\Code, %USERPROFILE%\.vscode
Using different terminals as PowerShell 7, PowerShell (default), and cmd; and each returns a different error code:
The terminal process "C:\Program Files\PowerShell\7\pwsh.exe" terminated with exit code: 3762504530.
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" terminated with exit code: 2.
The terminal process "C:\WINDOWS\System32\cmd.exe" terminated with exit code: 4294967295.
Disabling Windows Defender.
I've run out of ideas, I'd appreciate you'd shed some insight.

How to fix "mypy failed with error: Daemon has died . See Output panel for details." error in VS Code

I'm using the Mypy extension in VSCode, and it's giving me the error mypy failed with error: Daemon has died . See Output panel for details.
When I open the Output panel, it doesn't give me much more info than just telling my that it tried to run dmymy.EXE but that it had died.
How do I get the Mypy extension working again?
I've tried searching for this error on Google to no avail, and I've also tried rebooting VSCode, which gives me the same error every time.
Open up a Command Prompt (on Windows) or Terminal (non-Windows). Copy/paste the location of the dmypy.EXE script that it tried to run (from the output panel). Put start after the script. This will start the daemon.
The command looked like this for me:
C:\Users\MyUsername\AppData\Local\Programs\Python\Python38\Scripts\dmypy.EXE start
Now, reboot VS Code (I'm not sure if this is even needed), and the mypy extension should work again.

How to exit Command Prompt after launching VSCode

Here are the steps to reproduce the problem:
Open Command Prompt. ( cmd )
Run code . to launching VSCode.
Type exit and hit Enter in the Command Prompt.
Then the Command Prompt is just paused. I have to wait VSCode exit to let Command Prompt window closed.
Does anyone know why? How can I close Command Prompt window without exiting VSCode?
I found a solution here: https://github.com/Microsoft/vscode/issues/6608. It involves changing the code.cmd file (usually found under "C:\Users\yourUsername\AppData\Local\Programs\Microsoft VS Code\bin").
Changing the fifth line in that file from
call "%~dp0..\Code.exe" "%~dp0..\resources\app\out\cli.js" %*
to
start "" "%~dp0..\Code.exe" "%~dp0..\resources\app\out\cli.js" %*
will make the cmd window close right away. But that change will apparently break some other things (specifically the --wait flag), so I figure it's wiser to leave the code.cmd file alone.
Instead I made a copy ("codeNoCommandPrompt.cmd") right beside it and changed the line in there. That works fine for my usecase, namely having VS Code start on a specific folder alongside a bunch of other programms via a script.
I just tested it (using the latest VSCode 1.24.1), and it does work: the CMD shell session closes immediately when typing "exit".
Try calling the code.cmd script with its full path to see if the issue persists:
"C:\Program Files\Microsoft VS Code\bin\code.cmd" .
Try also the same command after having simplified the PATH (for testing)
set PATH=C:\Program Files\Microsoft VS Code\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
code .
Simply use this
code . && exit
Check your PATH variable, maybe you have duplicate entries for VS Code
Go System Properties -> Envieronment variables -> select PATH variable then click Edit.
Remove "C:**\Microsoft VS Code".
Leave intact "C:**\Microsoft VS Code\bin"
This happens when you reinstall vscode with "add to PATH" checked

Ctrl+c not working in integrated terminal which uses Powershell

I'm using Powershell in the integrated terminal by adding the following line to the settings.json file.
"terminal.integrated.shell.windows": "C:\\WINDOWS\\system32\\WindowsPowershell\\v1.0\\powershell.exe",
It works very well, but usually, when I'm in Powershell, typing ctrl+c cancels what I had typed and opens a new line.
But in the integrated terminal it just prints ^C.
Is there a way to fix it or find an alternative method to achieve this?
Thanks
This is with VSCode and not necessarily with the PowerShell Extension. You can see this by just using the default cmd.exe terminal, CTRL+C does nothing. It does not print the ^C at all, and creates no new line.
If you want this to work as expected in the normal command prompt or PowerShell.exe you will need to submit an issue to VSCode repository and request it.
I would expect this is all tied to the keybindings.json file. I went through that file but could not find a command available to the same function that occurs in the full command prompt or console. So this will likely need a new command added for VSCode.
If you search through the keybindings file you can see the terminal has that key CTRL+C bound to copySelection when terminalFocus && terminalTextSelected. This is why the ^C is being output, and no new line is being added.
A workaround:
Pressing Esc will erase the line back to the beginning.

Unable to open a second command window from batch file

I have following command to start after other which does not depend on each other. However, with following command, I only can start #1, #2. My command #3 does not start .
I would like to know if i have make any mistake. I did not see the the third line executed.
// make a directory
// startd adb logcat
// shell adb monkey
"test.bat"
mkdir c:\test_log_file
START "powershell Window" powershell adb logcat >> "C:\Testdata.txt"
START "Powershell Window 2" shell adb monkey -p com.android.browser
Based on your earlier question (how to open power shell window from a batch file to a new window), I'm assuming that "shell" is a command you have available to you, and not a typo. Two possibilities come to mind:
Is "shell" in the path? If not, you need to provide the full path to this command. (Probably not the answer, because if this were the issue you'd get a popup error message telling you that Windows can't find "shell".)
Although you've titled the window "Powershell Window 2" in your second START command, this command should actually open a cmd window, not a powershell window. Are you looking for a new powershell window, when you actually have a cmd window that's titled "Powershell Window 2"?
If you want to start a powershell window, the command should be:
START "Powershell Window 2" powershell -noexit shell adb monkey -p com.android.browser