Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOLVED] Terminal not found on linux since VSCode 1.20 #1550

Closed
zbendefy opened this issue Feb 13, 2018 · 9 comments
Closed

[SOLVED] Terminal not found on linux since VSCode 1.20 #1550

zbendefy opened this issue Feb 13, 2018 · 9 comments
Assignees

Comments

@zbendefy
Copy link

zbendefy commented Feb 13, 2018

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.

@zbendefy
Copy link
Author

zbendefy commented Feb 14, 2018

Followup:
I tried the following:

  • Set "terminal.integrated.shell.linux": "/usr/bin/gnome-terminal", but it didnt work, VSCode cant find the specified file. I checked on the file system but its there.

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.

@Tyriar
Copy link
Member

Tyriar commented Feb 14, 2018

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.

@zbendefy
Copy link
Author

zbendefy commented Feb 14, 2018

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?

@zbendefy
Copy link
Author

zbendefy commented Feb 15, 2018

Note that there is a similiar recent issue in the Issue tracker: #1554

However neither of my workspace folder nor my app launch path contains a space.

@pieandcakes
Copy link
Contributor

pieandcakes commented Feb 15, 2018

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.

@zbendefy
Copy link
Author

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.

@pieandcakes
Copy link
Contributor

pieandcakes commented Feb 15, 2018

@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?

@pieandcakes pieandcakes self-assigned this Feb 15, 2018
@pieandcakes pieandcakes added debugger more info needed The issue report is not actionable in its current state labels Feb 15, 2018
@zbendefy
Copy link
Author

zbendefy commented Feb 16, 2018

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 zbendefy changed the title Terminal not found on linux since VSCode 1.20 [SOLVED] Terminal not found on linux since VSCode 1.20 Feb 16, 2018
@pieandcakes
Copy link
Contributor

@zbendefy good to know. Thanks for solving it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants