flathub / com.visualstudio.code-oss

https://flathub.org/apps/details/com.visualstudio.code-oss
21 stars 8 forks source link

Default terminal should have the same environment as the host #25

Open cerulis64 opened 3 years ago

cerulis64 commented 3 years ago

Instead of including development tools in the flatpak package, i think it may be a better idea to just do the same thing that GNOME Builder does, which is to make the terminal the same as the host's terminal. This simplifies the package greatly for the user.

gasinvein commented 3 years ago

You can set default terminal shell to be spawned on host by adding something like this to your settings.json:

{
    "terminal.integrated.shell.linux": "/usr/bin/flatpak-spawn",
    "terminal.integrated.shellArgs.linux": [ "--host", "--", "bash" ]
}

Although a shell spawned through flatpak-spawn won't work as seamlessly as GTK VTE widget does, e.g. fish shell won't work at all and some TUI programs will break.

cerulis64 commented 3 years ago

What I mean is that it may be better to just simply enable this by default, or implement whatever GNOME Builder has (fish works on GNOME Builder, and the /bin in the terminal is the same as the host's /bin).

gasinvein commented 3 years ago

I doubt implementing spawn portal handling similar to what GNOME Builder does is even possible for an electron app, not to mention required skill and effort. Enabling flatpak-spawn-based shell by default, while not "just simply", should be possible, but it won't provide good experience - thus, instead there is an instruction in first run readme how to set it up.

cerulis64 commented 3 years ago

I see, makes sense. Perhaps this should be sent to upstream instead?

gasinvein commented 3 years ago

Upstream doesn't seem interested in supporting flatpak, and doesn't seem to support opensource builds like this either.

cerulis64 commented 3 years ago

Seems classic of Microsoft to not support open source builds.

FossPrime commented 3 years ago

I agree with the headline... not having my .local/bin in PATH was a real pain, as git hooks disregarded any settings in Code OSS. I made every effort to expose it to the sandbox, with no luck... used a manual override... which this was better documented. I guess we are pioneers of the sandboxed IDE

https://github.com/flathub/com.visualstudio.code-oss/issues/28

gasinvein commented 3 years ago

@rayfoss Adding host paths to the sandbox is not as straightforward as it may seem. For example, Python versions may differ on host and in flatpak SDK, thus, python programs installed to ~/.local/bin on host won't work in sandbox, and vise versa. Also ABI incompatibility is possible (and likely) for native programs. If you want to run programs from host - you really should use flatpak-spawn --host, not try to mix environments.

FDiskas commented 2 years ago

It should be default if the user installs this this from flathub