Skip to content

docs: mention Termux extension workarounds #6227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/build/build-vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ EOF
pushd lib/vscode-reh-web-linux-x64
# Make sure Code took the version we set in the environment variable. Not
# having a version will break display languages.
if ! jq -e .commit product.json ; then
if ! jq -e .commit product.json; then
echo "'commit' is missing from product.json"
exit 1
fi
Expand Down
32 changes: 32 additions & 0 deletions docs/termux.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Upgrade](#upgrade)
- [Known Issues](#known-issues)
- [Git won't work in `/sdcard`](#git-wont-work-in-sdcard)
- [Many extensions including language packs fail to install](#many-extensions-including-language-packs-fail-to-install)
- [Extra](#extra)
- [Create a new user](#create-a-new-user)
- [Install Go](#install-go)
Expand Down Expand Up @@ -87,6 +88,37 @@ Potential Workaround :
1. Create a soft-link from the debian-fs to your folder in `/sdcard`
2. Use git from termux (preferred)

### Many extensions including language packs fail to install

Issue: Android is not seen as a Linux environment but as a separate, unsupported platform, so code-server only allows [Web Extensions](https://code.visualstudio.com/api/extension-guides/web-extensions), refusing to download extensions that run on the server.\
Fix: None\
Potential workarounds :

Either

- Manually download extensions as `.vsix` file and install them via `Extensions: Install from VSIX...` in the Command Palette.

- Use an override to pretend the platform is Linux:

Create a JS script that patches `process.platform`:

```js
// android-as-linux.js
Object.defineProperty(process, "platform", {
get() {
return "linux"
},
})
```

Then use Node's `--require` option to make sure it is loaded before `code-server` starts:

```sh
NODE_OPTIONS="--require /path/to/android-as-linux.js" code-server
```

⚠️ Note that Android and Linux are not 100% compatible, so use these workarounds at your own risk. Extensions that have native dependencies other than Node or that directly interact with the OS might cause issues.

## Extra

### Create a new user
Expand Down