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

flatpak installed vscode's integrated terminal not having desired behaviour #44

Closed
mundusnine opened this issue Aug 25, 2018 · 11 comments

Comments

@mundusnine
Copy link

@mundusnine mundusnine commented Aug 25, 2018

Linux distribution and version

Debian 9 strecth

Flatpak version

Flatpak 0.8.9

Description of the problem

microsoft/vscode-cpptools#1550
The fact that the app is virtualized makes it so that you can't run : flatpak run org.godotengine.Godot
or any flatpak command in the integrated terminal of vscode. You can't also use gnome-terminal as your integrated terminal in vscode because of this. This makes it also troublesome when trying to use external apps that are used by the extensions.(i.e. My haxe extensions in vscode can't find haxe in my path even though it is installed).

Haxe is available in /usr/bin/ so I guess vscode should detect it.

Steps to reproduce

  • Install vscode with flatpak
  • use the integrated terminal of vscode(try with sh/bash) and call flatpak list

Potential solution:

Adding --filesystem=/bin/ access to vscode ? Are there any reasons for not doing this ? What would be the work around.

@mundusnine

This comment has been minimized.

Copy link
Author

@mundusnine mundusnine commented Aug 25, 2018

Probably the real issue

Ok so I found out that the installation of Vscode considers only some apps in the /usr/bin/*.

So if you do in the integrated terminal of vscode:

which g++
which bash 
which python

It will work. But if you do:

which gnome-terminal
which haxe

It won't work saying no gnome-terminal in (/app/bin:/usr/bin:/home/jsnadeau/.var/app/com.visualstudio.code/data/node_modules/bin)

This behavior seems weird. I thought at first that it could be because haxe is a x-sharedlib but python is the same and it works.

Does the manifest determine what apps from usr/bin/ can be added ? Is there a way to tell it to use everything or just some apps.(looked in the docs and doesn't seem so)

@barthalion

This comment has been minimized.

Copy link
Member

@barthalion barthalion commented Aug 25, 2018

The main feature of Flatpak is sandboxing and there is no way to disable it. /usr and /bin you see in the integrated terminal come from Sdk, not your own system. If you pass --talk-name=org.freedesktop.Flatpak you can spawn commands on host with flatpak-spawn --host.

@barthalion barthalion closed this Aug 25, 2018
@mundusnine

This comment has been minimized.

Copy link
Author

@mundusnine mundusnine commented Aug 25, 2018

So how can vscode-extensions use outside components ? I talked about haxe but vscode can't use pylint either since it's limited to what is present in the Sdk.

Setting their path in the user settings doesn't work either.

@allo-

This comment has been minimized.

Copy link

@allo- allo- commented Sep 14, 2018

The main feature of Flatpak is sandboxing and there is no way to disable it. /usr and /bin you see in the integrated terminal come from Sdk, not your own system.
How do I install stuff into the sandboxed /usr? Is there something like

flatpak add-to-sandbox com.visualstudio.code org.gnome.gnome-terminal # add gnome terminal package to the vscode sandbox

possible?

@TingPing

This comment has been minimized.

Copy link
Member

@TingPing TingPing commented Sep 14, 2018

@allo- No, they could have conflicting files.

@allo-

This comment has been minimized.

Copy link

@allo- allo- commented Sep 14, 2018

Is there another way to get vscode to work? Internal terminal doesn't seem to be usable for debugging and whitelisting /usr isn't visible inside the jail. At least putting an xterm inside would be helpful.

@TingPing

This comment has been minimized.

Copy link
Member

@TingPing TingPing commented Sep 14, 2018

For the terminal to run on the host requires modifications to how the terminal works.

@allo-

This comment has been minimized.

Copy link

@allo- allo- commented Sep 14, 2018

I guess running inside the jail would be the nicer solution, but for the moment I would like anything which allows me to test vscode with gdb debugging (Compiling a sample project and then pressing F5 should work ;-)).

@TingPing

This comment has been minimized.

Copy link
Member

@TingPing TingPing commented Sep 14, 2018

Well gdb is already in the SDK, but ofc that is only useful if you compile software against the SDK.

Really IDEs just need to be designed to be sandbox friendly which I know isn't helpful now.

@danielfm123

This comment has been minimized.

Copy link

@danielfm123 danielfm123 commented Nov 3, 2018

For developing is better to use snap IDEs like visual studio or pycharm.

@thiblahute

This comment has been minimized.

Copy link

@thiblahute thiblahute commented Jul 24, 2019

For reference, I am using fedora silverblue with toolbox and I added the following to my settings:

    "terminal.integrated.shellArgs.linux": [
        "/var/home/thiblahute/bin/my-devtools/vscode-enter"
    ],

where the vscode-enter script contains:

#!/bin/sh

flatpak-spawn --host toolbox enter

This actually works pretty well for me :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.