Skip to content

Commit ee024f3

Browse files
authored
docs: mention Termux extension workarounds (#6227)
1 parent 0703ef0 commit ee024f3

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

ci/build/build-vscode.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ EOF
112112
pushd lib/vscode-reh-web-linux-x64
113113
# Make sure Code took the version we set in the environment variable. Not
114114
# having a version will break display languages.
115-
if ! jq -e .commit product.json ; then
115+
if ! jq -e .commit product.json; then
116116
echo "'commit' is missing from product.json"
117117
exit 1
118118
fi

docs/termux.md

+32
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [Upgrade](#upgrade)
99
- [Known Issues](#known-issues)
1010
- [Git won't work in `/sdcard`](#git-wont-work-in-sdcard)
11+
- [Many extensions including language packs fail to install](#many-extensions-including-language-packs-fail-to-install)
1112
- [Extra](#extra)
1213
- [Create a new user](#create-a-new-user)
1314
- [Install Go](#install-go)
@@ -87,6 +88,37 @@ Potential Workaround :
8788
1. Create a soft-link from the debian-fs to your folder in `/sdcard`
8889
2. Use git from termux (preferred)
8990

91+
### Many extensions including language packs fail to install
92+
93+
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.\
94+
Fix: None\
95+
Potential workarounds :
96+
97+
Either
98+
99+
- Manually download extensions as `.vsix` file and install them via `Extensions: Install from VSIX...` in the Command Palette.
100+
101+
- Use an override to pretend the platform is Linux:
102+
103+
Create a JS script that patches `process.platform`:
104+
105+
```js
106+
// android-as-linux.js
107+
Object.defineProperty(process, "platform", {
108+
get() {
109+
return "linux"
110+
},
111+
})
112+
```
113+
114+
Then use Node's `--require` option to make sure it is loaded before `code-server` starts:
115+
116+
```sh
117+
NODE_OPTIONS="--require /path/to/android-as-linux.js" code-server
118+
```
119+
120+
⚠️ 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.
121+
90122
## Extra
91123

92124
### Create a new user

0 commit comments

Comments
 (0)