Closed manero6 closed 1 year 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"
]
}
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.
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
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:
org.freedesktop.Sdk.Extension.*
) e.g. Go, dotnet. If you install these flatpaks, the vscodium flatpak can access them under /usr/lib/sdk/*
. You will usually need to configure your environment variables such as PATH. (You can do this though usual shell methods such as .bashrc, or flatpak-overrides if that doesn't seem to work). Often the extensions themselves will have settings that will let you configure alternative paths for tools.
flatpak enter com.vscodium.codium <PATH_TO_TOOL>
from your host to run a tool in the vscodium flatpak (i think vscode has to be running first). I have found this a bit flaky, there are often issues with environment, current working directory etc.exec flatpak-spawn --host /usr/bin/env -- toolbox run "$@"
). Often a good solution, especially for modern sdks which export a small number of binaries (such as go). Becomes trickier when there are lots of binaries required for the toolchain (e.g. java).Helpful commands:
flatpak-spawn --host /usr/bin/env -- <CMD> <ARGS>...
(works in both flatpak environments and toolbox)flatpak enter com.vscodium.codium /usr/bin/env -- <CMD> <ARGS>...
(works in host, not toolbox, if you are in the toolbox, you can combine with the previous to escape from the toolbox before entering the flatpak)toolbox run /usr/bin/env -- <CMD> <ARGS>...
. (likewise, if you are the flatpak environment, you need to combine with the above command to escape from the flatpak before entering the toolbox).(you maybe don't strictly need the /usr/bin/env
, but it can help in some cases).
command -v flatpak-spawn > /dev/null 2>&1
(since flatpak-spawn
command is not available in host OS environment, at least for me on Silverblue) - note that the output is suppressed to use in scripts (exit status is 0 to indicate true, non-zero to indicate false).[ -n "$TOOLBOX_PATH" ]
(since toolbox sets this environment variable)if
, &&
etc. to detect the specific environmentMaybe 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.
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.
Hey, I'll close this very old issue, if the problem persists, don't hesitate and open a new issue.
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.