Visual Studio Code in Termux
This guide provides configuration and setup instructions for running VS Code on Termux with proper language server support.
Branding Code-OSS as Visual Studio Code
To make Code-OSS appear as Visual Studio Code in Termux, edit the product configuration file at:
$PREFIX/lib/code-oss/resources/app/product.jsonAdd or update these configuration properties:
{
"nameShort": "Code",
"nameLong": "Visual Studio Code",
"applicationName": "code",
"dataFolderName": ".vscode",
"sharedDataFolderName": ".vscode-shared",
"linuxIconName": "code",
"urlProtocol": "vscode",
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.vo.msecnd.net/gallery",
"itemUrl": "https://marketplace.visualstudio.com/items"
},
"linkProtectionTrustedDomains": [
"https://open-vsx.org",
"https://marketplace.visualstudio.com",
"https://vscode.vo.msecnd.net"
]
}Language Server Setup for Termux
VS Code language servers in Termux may require symlink configuration to use system-installed binaries. Follow these steps for each language.
Rust Language Server
- Install the Rust analyzer package:
apt install rust-analyzer- Remove the broken bundled binary from the extension:
rm $HOME/.vscode/extensions/rust-lang.rust-analyzer-*/server/rust-analyzer- Create a symlink to the system binary:
ln -s $(which rust-analyzer) $HOME/.vscode/extensions/rust-lang.rust-analyzer-*/server/rust-analyzerNote: Replace the wildcard * with the specific version number if the glob pattern doesn't work.
Lua Language Server
- Install the Lua language server package:
apt install lua-language-server- Remove the broken bundled binary from the extension:
rm $HOME/.vscode/extensions/sumneko.lua-*/server/bin/lua-language-server- Create a symlink to the system binary:
ln -s $(which lua-language-server) $HOME/.vscode/extensions/sumneko.lua-*/server/bin/lua-language-serverNote: Replace the wildcard * with the specific version number if the glob pattern doesn't work.
CodeLLDB Debugger
- Install the CodeLLDB package:
apt install codelldb- Remove the broken bundled binaries from the extension:
rm -rf $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/adapter/codelldb $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/lldb/bin/lldb $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/lldb/bin/lldb-server $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/lldb/bin/lldb-argdumper- Create symlinks to the system binaries:
ln -s $(which codelldb) $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/adapter/codelldb
ln -s $(which lldb) $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/lldb/bin/lldb
ln -s $(which lldb-server) $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/lldb/bin/lldb-server
ln -s $(which lldb-argdumper) $HOME/.vscode/extensions/vadimcn.vscode-lldb-*/lldb/bin/lldb-argdumperNote: Replace the wildcard * with the specific version number if the glob pattern doesn't work.
Troubleshooting
If language servers or debuggers are not working after setup:
- Verify the symlinks exist:
ls -l ~/.vscode/extensions/[extension-name]*/server/orls -l ~/.vscode/extensions/[extension-name]*/adapter/ - Ensure symlink targets are executable:
file $(which codelldb)orfile $(which lldb) - Reload VS Code or restart the language server/debugger from the command palette (
Ctrl+Shift+P) - Check VS Code's output panel for language server or debugger errors