6

I keep using Visual Studio Code debug for long time. But it began to fails to use debug from yesterday.

It reports that the terminal process failed to launch: A native exception occurred during launch (File not found: ).

I can use PowerShell in the terminal.

I have tried the solution in Troubleshoot Terminal launch failures, but none of them works.

Visual Studio Code version: 1.47.3

Operating system version: Windows 10 1909 build 18363.959

All extensions:

    albert.TabOut
    christian-kohler.path-intellisense
    CoenraadS.bracket-pair-colorizer-2
    Equinusocio.vsc-community-material-theme
    Equinusocio.vsc-material-theme
    equinusocio.vsc-material-theme-icons
    eryouhao.brackets-light-pro
    formulahendry.code-runner
    formulahendry.terminal
    Gruntfuggly.todo-tree
    HookyQR.beautify
    James-Yu.latex-workshop
    kisstkondoros.vscode-gutter-preview
    manasxx.background-cover
    marlosirapuan.nord-deep
    MS-CEINTL.vscode-language-pack-zh-hans
    ms-python.python
    ms-python.vscode-pylance
    ms-vscode.cpptools
    naumovs.color-highlight
    niudai.vscode-zhihu
    nnthink.aixcoder
    redhat.java
    skacekachna.win-opacity
    sldobri.nord-5-stars
    TabNine.tabnine-vscode
    VisualStudioExptTeam.vscodeintellicode
    vscjava.vscode-java-debug
    vscjava.vscode-java-dependency
    vscjava.vscode-java-pack
    vscjava.vscode-java-test
    vscjava.vscode-maven
    vscode-icons-team.vscode-icons
    wix.vscode-import-cost
    yzhang.markdown-all-in-one
    zhuangtongfa.material-theme

File settings.json

    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Yi Wang
  • 81
  • 1
  • 1
  • 4
  • [Image](https://i.stack.imgur.com/fnWgg.jpg) – Yi Wang Aug 09 '20 at 01:37
  • 1
    Probably this answer can fix this issue [Visual Studio (VS-code) code terminal is failed to launch](https://stackoverflow.com/a/63704415/10944219) – tom Sep 02 '20 at 11:28

7 Answers7

6

In my case, this problem arose after updating Visual Studio Code version to 1.54.3 on Ubuntu 18.04 (Bionic Beaver).

This problem is resolved by restarting Visual Studio Code after the update.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mohit Patil
  • 305
  • 1
  • 4
  • 11
2

Yep, that's kind of what my problem was...PowerShell had been blocked at a system administrator level.

Make sure that you can actually run PowerShell from the command line or start window.

Windows 10 popup

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
1

I fixed it by changing "terminal.integrated.inheritEnv" to false in settings.json.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Yi Wang
  • 81
  • 1
  • 1
  • 4
1

I had the error. To fix it, I looked at all the terminal settings in Visual Studio Code and checked out the ones that weren't set to the default value.

Eventually, I found that the path to my PowerShell had changed to the preview version I had installed. Reverting this to its default got it working again.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user489998
  • 4,473
  • 2
  • 29
  • 35
0

I also had the same issue and asked the question one week before, yet I didn't get a solution. Here is a link of my question: link

One solution I got:

The issue arises when you delete some of its files before by mistake and you don't know try to remember that or simply recover your PC to three weeks ago at least, so all files will be placed suitably.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mr. abhi
  • 221
  • 1
  • 2
  • 7
  • 1
    Thanks a lot. I solved it by change "terminal.integrated.inheritEnv" to false. I think it was changed when I uupgrade my windows10. – Yi Wang Aug 10 '20 at 11:25
0

In macOS, Visual Studio Code shows this error message when you have installed the incorrect .dmg file.

Below is the data:

PowerShell 7.3.2

  • x64 processors - powershell-7.3.2-osx-x64.pkg
  • M1 processors - powershell-7.3.2-osx-arm64.pkg

PowerShell 7.2.9

  • x64 processors - powershell-7.2.9-osx-x64.pkg
  • M1 processors - powershell-7.2.9-osx-arm64.pkg

Ideally I did not made any changes in the settings.json file.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

I had the same issue after reinstalling the Terminal with the new fancy version in MS Store. It turns out the terminal start path changed after reinstalling - After resetting, the problem went away.

You can find the configuration for the 'start path' in Terminal > Integrated

Demonstration of Start Path

Raul Chiarella
  • 518
  • 1
  • 8
  • 25
  • 1
    As it was currently written, your answer was a little unclear and had some problems with grammar. I edited to make it a little better but you can try using ChatGPT or other AI tool to improve your answer and make it organized and correct. If you are not profficient in English, it is not a problem - You can paste the text you wrote on a AI and ask: Can you please correct the spelling and improve the grammar for the following text below? – Raul Chiarella Aug 18 '23 at 21:31