Hi! I recently updated to VSCode 1.20.0 (from 1.19). I'm using Linux Mint 18.3 (64 bit Cinnamon), and I have the following extensions installed: C/C++ (0.14.6), CMake, CMake Tools, CMake Tools Helper.
When I try to launch a debug session, I get the following error message:
Unable to start debugging. No terminal is available to launch the debugger. Please install Gnome Terminal or XTerm
I have both xterm and gnome-terminal installed.
Note that VSCode seems to use the sh terminal, but in 1.19 it used the gnome-terminal, so this might be a VSCode bug
EDIT - SOLVED:
My issue was that I installed VSCode from the Linux Mint software manager, and the vscode there is installed with Flatpak. Flatpak caused my VSCode to run in virtualized environment, where the terminal app was not available for some reason. I solved the issue by installing VSCode from the official website.
Followup:
I tried the following:
Next I tried to locate the file in the integrated terminal (which is an sh instead of the regular terminal), and when I ran ls on /usr/bin, there was no gnome-terminal there (even though in the file explorer, and in an linux mint terminal it is there)
Also I listed the running processes (ps ax) and it wasn't the same as the processes in my regular terminal. There were a lot fewer, and there was only processes for vscode It seems that the integrated terminal is running inside some kind of virtual machine where the full filesystem is not available.
FYI "terminal.integrated.shell.linux": "/usr/bin/gnome-terminal" will never work, gnome-terminal is a terminal emulator just like VS Code's integrated terminal. Both gnome-terminal and the integrated terminal run shells like bash, sh, zsh, etc.
Ah thanks! I tried /bin/bash, and it appeared (the integrated terminal is now the bash instead of sh), but debugging still doesnt work (the same error message appears, that no terminal was found to launch the debugger)
So what does the error message mean? Which terminal is it trying to launch? The external one?
Note that there is a similiar recent issue in the Issue tracker: https://github.com/Microsoft/vscode-cpptools/issues/1554
However neither of my workspace folder nor my app launch path contains a space.
Hi, we use gnome-terminal by default and fallback to xTerm. if you have neither one installed, currently the extension won't work. We have an issue to integrate more terminal options but haven't had the time to invest in it yet. For gnome-terminal, there have been reports of an issue with a newer version of gnome-terminal changing the entry point from an executable to a script, which is causing issues. If you search our issues page you can find people reporting this on newer versions of Ubuntu. I would say if you can check if that is the problem that would be helpful to know.
The "terminal.integrated.shell.linux" setting is used by VSCode and not our extension.
The issue is wierd because on my home machine, with the same version of everything (min18.3, vscode 1.20), the debugging works.
Now the difference in the two, is that if I enter "ps ax", there is a difference between the two.
On the faulty machine, where debugging doesnt work, "ps ax" returns only processes of vscode.
Also on the faulty machine, there is no such file as "/usr/bin/gnome-terminal" (even though in the explorer I could find it)
Also if I run "ls / -la" on the root directory there is a difference, some folders are marked as nfsuser or nfsroot or something like that (I can't remember, I'll check and update later)
On the machine where it works, ps ax returns every running process from my machine, the /usr/bin/gnome-terminal exists, and the "ls / -la" doesnt show that nfsuser or what.
It's like if on the faulty machine VSCode would run on a virtual environment or something.
@zbendefy Do you have the same level of access on the faulty machine? I saw this post where someone had this comment:
my OS version is ubuntu 16.04 LTS and i check the directory/usr/bin ,there are two files,one is the python file named gnome-terminal and another one is gnome-terminal.real ,the real file to lunch terminal is the second one (type gnome-terminal.real in a terminal to lunch a new terminal)—— gnome-terminal.real ,it means that you must use command
python /usr/bin/gnome-terminal to lunch the terminal.but this is a python file , i guess vscode just find the file gnome-terminal and do something.
Can you check that and see if that might be the problem?
I found the problem. It's that for some reason, the new faulty VSCode is running inside flatpak (hence the virtual machine I mentioned), and in flatpak the debugger cannot start!
I Installed it trough the Linux Mint software manager, and it installs it with flatpak. Ubuntu may be affected too.
If I install it trough the website .deb, it works all right.
@zbendefy good to know. Thanks for solving it.
Most helpful comment
I found the problem. It's that for some reason, the new faulty VSCode is running inside flatpak (hence the virtual machine I mentioned), and in flatpak the debugger cannot start!
I Installed it trough the Linux Mint software manager, and it installs it with flatpak. Ubuntu may be affected too.
If I install it trough the website .deb, it works all right.