flathub / com.vscodium.codium

https://flathub.org/apps/details/com.vscodium.codium
95 stars 20 forks source link

Different PATH and binaries from system #92

Closed manero6 closed 1 year ago

manero6 commented 2 years ago

https://github.com/VSCodium/vscodium/issues/840

Inside VSCodium I have a differrent python version and therefore can't use the system modules.

PATH inside VSCodium is different than system's PATH.

xlejo commented 2 years ago

@manero6. That's is because you run the shell from the sandboxed app. See https://github.com/flathub/com.vscodium.codium#host-shell.

Add the following JSON configuration in your settings.json for use the shell of the host (tested in v1.66.2):

{
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "/usr/bin/flatpak-spawn",
            "args": ["--host", "--env=TERM=xterm-256color", "bash"]
        }
    },
    "terminal.integrated.defaultProfile.linux": "bash"
}

If that doesn't work, then use the deprecated configuration (for example, in VSCode proprietary):

{
    "terminal.integrated.shell.linux": "/usr/bin/flatpak-spawn",
    "terminal.integrated.shellArgs.linux": [
        "--host",
        "--env=TERM='xterm-256color'",
        "/bin/bash"
    ]
}
yajo commented 2 years ago

I tested yesterday the tilix app from fedora flatpak registry. It opens a host shell.

I wonder what technique they use, because codium could do the same.

chintan-mishra commented 2 years ago

I am facing a similar issue. VSCodium is installed using Flatpak on Fedora Kinoite/Fedora CoreOS. I have my complete development runtimes, SDKs, etc. in a toolbx. Whenever I open a terminal it opens the toolbx container's environment. However, the extensions cannot find the same developer tools.

I am investigating if the extensions are running in the same environment as that of the terminal set in VSCodium or on the host or within the flatpak environment.

Please tell me how we can get extensions to work that are using tools from a toolbx

x11x commented 2 years ago

I am investigating if the extensions are running in the same environment as that of the terminal set in VSCodium or on the host or within the flatpak environment.

Pretty sure extensions run in the flatpak environment (not the host OS environment or the toolbox environment). Everything run internally by vscode is in this environment I think (except possibly the integrated terminal, if you have set it up as described above).

I have been using a similar set up for a while (Fedora Silverblue, Toolbox and Flatpak Vscodium). It gets confusing, but overall I am happy with it. I often end up having to write wrapper scripts but have been able to get most things to work.

The easiest/best solution is usually to install things under $HOME because this shared by all 3 environments.

Other tricks that help are:

Helpful commands:

(you maybe don't strictly need the /usr/bin/env, but it can help in some cases).

Maybe there is a better solution for sharing other directories between toolbox and flatpak that I haven't found yet

As you have discovered, and as the previous comment explains, you can get vscode's integrated terminal to use your toolbox environment. Also in the integrated terminal, you can usually get a bash shell in the Vscodium flatpak environment itself by clicking the drop down menu next to the + in the integrated terminal and selecting ("bash"). This should be the same environment as if you flatpak enter from the host.

chintan-mishra commented 2 years ago

I was using asdf-vm to install my programming runtimes. I resolved my issue by simply . $HOME/.asdf/asdf.sh

Reading material: https://asdf-vm.com/guide/getting-started.html#_3-install-asdf

After source-ing the shell script I had complete developer tools and VSCodium extensions running.

noonsleeper commented 1 year ago

Hey, I'll close this very old issue, if the problem persists, don't hesitate and open a new issue.