Files

99 lines
3.0 KiB
Markdown
Raw Permalink Normal View History

2022-07-07 05:56:53 -07:00
# Visual Studio Code Flatpak<!-- omit in toc -->
2022-06-28 23:07:15 +00:00
2022-07-02 00:32:49 -07:00
🚨 Warning: This is an unofficial Flatpak build of Visual Studio Code, generated from the official Microsoft-built .deb packages [here](https://github.com/flathub/com.visualstudio.code/blob/master/com.visualstudio.code.yaml#L103).
2022-06-27 13:06:00 -07:00
2022-07-07 05:56:53 -07:00
## Table of Contents<!-- omit in toc -->
2022-06-28 23:07:15 +00:00
- [Usage](#usage)
- [Execute commands in the host system.](#execute-commands-in-the-host-system)
- [Use host shell in the integrated terminal.](#use-host-shell-in-the-integrated-terminal)
- [Support for language extension.](#support-for-language-extension)
- [Support](#support)
## Usage
Most functionality works out of the box, though please note that flatpak runs in an isolated environment and some work is necessary to enable those features.
### Execute commands in the host system.
To execute commands on the host system, run inside the sandbox:
`$ flatpak-spawn --host <COMMAND>`
2023-01-30 10:33:29 -08:00
or
`$ host-spawn <COMMAND>`
- Most users seem to report a better experience with `host-spawn`
2022-06-28 23:07:15 +00:00
### Use host shell in the integrated terminal.
Another option to execute commands is to use your host shell in the integrated terminal instead of the sandbox one.
2023-12-17 16:44:21 -05:00
For that go to `File -> Preferences -> Settings` and find `Features > Terminal > Integrated > Profiles`, then click on `Edit in settings.json` (The important thing here is to open settings.json)
2022-06-28 23:07:15 +00:00
2023-01-30 10:33:29 -08:00
And make sure that you have the following lines there:
`flatpak-spawn --host`
2022-06-28 23:07:15 +00:00
```
{
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/usr/bin/flatpak-spawn",
2023-10-22 17:50:56 -05:00
"args": ["--host", "--env=TERM=xterm-256color", "bash"],
2023-01-30 10:33:29 -08:00
"icon": "terminal-bash",
"overrideName": true
2022-06-28 23:07:15 +00:00
}
}
}
```
2023-01-30 10:33:29 -08:00
`host-spawn`
```
2023-12-17 16:44:21 -05:00
{
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
2023-01-30 10:33:29 -08:00
"bash": {
"path": "/app/bin/host-spawn",
"args": ["bash"],
"icon": "terminal-bash",
"overrideName": true
2023-12-17 16:44:21 -05:00
}
}
}
2023-01-30 10:33:29 -08:00
```
- You can change **bash** to any terminal you are using: zsh, fish, sh.
- `overrideName` allows for the 'name' (or whatever you set it to) of the shell you're using to appear (e.g. normally zsh, fish, sh).
2022-06-28 23:07:15 +00:00
### Support for language extension.
2022-06-28 23:12:45 +00:00
Some Visual Studio extension depends on packages that might exist on your host, but they are not accessible thought Flatpak. Like support to programming languages: gcc, python, etc..
2022-06-28 23:07:15 +00:00
2022-06-28 23:13:44 +00:00
**See available SDK:**
2022-06-28 23:07:15 +00:00
```
2023-01-30 10:33:29 -08:00
$ flatpak run --command=sh com.visualstudio.code
$ ls /usr/bin (shared runtime)
$ ls /app/bin (bundled with this flatpak)
2022-06-28 23:07:15 +00:00
```
2022-06-28 23:15:06 +00:00
**Getting support for additional languages, you have to install SDK extensions, e.g.**
2022-06-28 23:07:15 +00:00
```
2023-01-30 10:33:29 -08:00
$ flatpak install flathub org.freedesktop.Sdk.Extension.dotnet
$ flatpak install flathub org.freedesktop.Sdk.Extension.golang
$ FLATPAK_ENABLE_SDK_EXT=dotnet,golang flatpak run com.visualstudio.code
2022-06-28 23:07:15 +00:00
```
2022-06-28 23:13:44 +00:00
**Finding other SDK**
2022-06-28 23:07:15 +00:00
`flatpak search <TEXT>`
## Support
Please open issues under: https://github.com/flathub/com.visualstudio.code/issues