Merge pull request #375 from ran-dall/host-spawn

Add host-spawn
This commit is contained in:
Bilal Elmoussaoui
2023-08-22 19:42:59 +02:00
committed by GitHub
2 changed files with 48 additions and 13 deletions
+32 -13
View File
@@ -1,6 +1,5 @@
# Visual Studio Code Flatpak<!-- omit in toc -->
🚨 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).
## Table of Contents<!-- omit in toc -->
@@ -11,25 +10,31 @@
- [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>`
or
`$ host-spawn <COMMAND>`
- Most users seem to report a better experience with `host-spawn`
### 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.
For that go to `File -> Preferences -> Settings` and find `Terminal > Integrated > Profiles`, then click on `Edit in settings.json` (The important thing here is to open settings.json)
And make sure that you have the following lines there
And make sure that you have the following lines there:
`flatpak-spawn --host`
```
{
@@ -38,11 +43,27 @@ And make sure that you have the following lines there
"bash": {
"path": "/usr/bin/flatpak-spawn",
"args": ["--host", "--env=TERM=xterm-256color", "bash"]
"icon": "terminal-bash",
"overrideName": true
}
}
}
```
* You can change **bash** to any terminal you are using: zsh, fish, sh.
`host-spawn`
```
"terminal.integrated.defaultProfile.linux": "bash",
"bash": {
"path": "/app/bin/host-spawn",
"args": ["bash"],
"icon": "terminal-bash",
"overrideName": true
},
```
- 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).
### Support for language extension.
@@ -51,25 +72,23 @@ Some Visual Studio extension depends on packages that might exist on your host,
**See available SDK:**
```
flatpak run --command=sh com.visualstudio.code
ls /usr/bin (shared runtime)
ls /app/bin (bundled with this flatpak)
$ flatpak run --command=sh com.visualstudio.code
$ ls /usr/bin (shared runtime)
$ ls /app/bin (bundled with this flatpak)
```
**Getting support for additional languages, you have to install SDK extensions, e.g.**
```
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
$ 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
```
**Finding other SDK**
`flatpak search <TEXT>`
## Support
Please open issues under: https://github.com/flathub/com.visualstudio.code/issues
+16
View File
@@ -135,6 +135,22 @@ modules:
- type: file
path: krb5.conf
- name: host-spawn
buildsystem: simple
build-commands:
- install -Dm755 host-spawn /app/bin/host-spawn
sources:
- type: file
url: https://github.com/1player/host-spawn/releases/download/1.4.1/host-spawn-x86_64
sha256: d81bb6125ec73a9a2e26266c48787367fbcb665d67c2e7fb42217f0981106cf7
dest-filename: host-spawn
only-arches: [x86_64]
- type: file
url: https://github.com/1player/host-spawn/releases/download/1.4.1/host-spawn-aarch64
sha256: 29bff846d72e37093b3fdf7859bae16addd64acc98087f8c059548df3c2273c4
dest-filename: host-spawn
only-arches: [aarch64]
- name: zypak
sources:
- type: git