question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Terminal is not working on Termux.

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Firefox 103.0.2 (64-bit)
  • Local OS: Windows 10 LTSC 21H2
  • Remote OS: Android 10, Termux 0.118.0, Node.js v16.16.0
  • Remote Architecture: aarch64
  • code-server --version: 4.6.0

Steps to Reproduce

  1. Install code-server@4.6.0 on Termux 0.118.0.
  2. Open Termux app, run code-server.
  3. Open a browser, login code-server, and open a terminal.

Expected

Something like this.

2022-08-24 105543

Actual

20220824104253

Logs

~/.../pictures/Screenshots $ code-server
[2022-08-24T02:34:11.738Z] info  code-server 4.6.0 6d3f9ca6a6df30a1bfad6f073f6fa33c0e63abdb
[2022-08-24T02:34:11.740Z] info  Using user-data-dir ~/.local/share/code-server
[2022-08-24T02:34:11.763Z] info  Using config file ~/.config/code-server/config.yaml
[2022-08-24T02:34:11.763Z] info  HTTP server listening on http://0.0.0.0:8080/ 
[2022-08-24T02:34:11.763Z] info    - Authentication is enabled
[2022-08-24T02:34:11.764Z] info      - Using password from ~/.config/code-server/config.yaml
[2022-08-24T02:34:11.764Z] info    - Not serving HTTPS 
[10:34:26] Extension host agent started.
[IPC Library: Pty Host] The factory function of "vs/platform/terminal/node/ptyHostMain" has thrown an exception
[IPC Library: Pty Host] Error: Platform not supported
    at D (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:19:764)
    at E (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:19:110)
    at new E (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:19:1631)
    at Object.<anonymous> (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:24:39279)
    at Function.o._safeInvokeFunction (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:1337)
    at Function.o._invokeFactory (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:1522)
    at o.complete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:1801)
    at o._onModuleComplete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1112)
    at o._onModuleComplete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1358)
    at o._onModuleComplete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1358)
    at o._onModuleComplete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1358)
    at o._onModuleComplete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1358)
    at o._resolve (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:510)
    at o.defineModule (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144)
    at i (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10605)
    at Object.R (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:6093)
    at Function.o._safeInvokeFunction (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:1337)
    at Function.o._invokeFactory (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:1522)
    at o.complete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:1801)
    at o._onModuleComplete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1112)
    at o._onModuleComplete (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1358)
    at o._resolve (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:510)
    at o.defineModule (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144)
    at y (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825)
    at h (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.nls.js:3:61)
    at e._createAndEvalScript (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598)
    at /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2237
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
[IPC Library: Pty Host] Here are the modules that depend on it:
[IPC Library: Pty Host]% [ '===anonymous1===' ]
[10:34:27] Deleted from disk ms-toolsai.jupyter /data/data/com.termux/files/home/.local/share/code-server/extensions/ms-toolsai.jupyter-2022.5.1001610507
[IPC Library: Pty Host] Unknown channel: heartbeat
[IPC Library: Pty Host] Unknown channel: log
[IPC Library: Pty Host] Unknown channel: ptyHost
[IPC Library: Pty Host] Unknown channel: ptyHost
[IPC Library: Pty Host] Unknown channel: ptyHost
[IPC Library: Pty Host] Unknown channel: ptyHost
[IPC Library: Pty Host] Unknown channel: ptyHost
[IPC Library: Pty Host] Unknown channel: ptyHost
[IPC Library: Pty Host] Unknown channel: ptyHost
rejected promise not handled within 1 second: Unknown channel: Channel name 'log' timed out after 1000ms
[10:34:29] [Unknown channel: Channel name 'log' timed out after 1000ms]
[10:34:32] No ptyHost heartbeat after 6 seconds
[10:34:37] No ptyHost heartbeat after 12 seconds
[10:34:54] [100.120.35.17][ac715c7d][ManagementConnection] New connection established.
[10:34:55] [100.120.35.17][23fb10a3][ExtensionHostConnection] New connection established.
[10:34:55] [100.120.35.17][23fb10a3][ExtensionHostConnection] <28883> Launched Extension Host Process.
[IPC Library: Pty Host] Unknown channel: ptyHost
rejected promise not handled within 1 second: Unknown channel: Channel name 'ptyHost' timed out after 1000ms
[10:34:57] [Unknown channel: Channel name 'ptyHost' timed out after 1000ms]
[IPC Library: File Watcher] Loading "@parcel/watcher" failed
[IPC Library: File Watcher] Error: dlopen failed: cannot locate symbol "_ZTV17BruteForceBackend" referenced by "/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/@parcel/watcher/build/Release/watcher.node"...
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at load (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/node-gyp-build/index.js:22:10)
    at Object.<anonymous> (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/@parcel/watcher/index.js:1:42)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at r (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101)
    at e.load (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1720)
    at e.load (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at Object.errorback (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10423)
    at e.triggerErrorback (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11369)
    at /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11075
    at e.load (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1737)
    at e.load (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at o._loadModule (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10432)
    at o._resolve (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452)
    at o.defineModule (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144)
    at y (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825)
    at h (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/files/node/watcher/watcherMain.js:14:32126)
    at Object.<anonymous> (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/files/node/watcher/watcherMain.js:14:43638)
    at e._createAndEvalScript (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598)
    at /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2237
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
[IPC Library: File Watcher] Here are the modules that depend on it:
[IPC Library: File Watcher]% [ 'vs/platform/files/node/watcher/parcel/parcelWatcher' ]
[10:35:11] Using the in-memory credential store as the operating system's credential store could not be accessed. Please see https://aka.ms/vscode-server-keyring on how to set this up. Details: Cannot find module '../build/Release/keytar.node'
Require stack:
- /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/keytar/lib/keytar.js
- /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/out/node/util.js
- /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/out/node/cli.js
- /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/out/node/entry.js
[IPC Library: Pty Host] Unknown channel: ptyHost
[IPC Library: Pty Host] Unknown channel: ptyHost
rejected promise not handled within 1 second: Unknown channel: Channel name 'ptyHost' timed out after 1000ms
[10:35:18] [Unknown channel: Channel name 'ptyHost' timed out after 1000ms]
rejected promise not handled within 1 second: Unknown channel: Channel name 'ptyHost' timed out after 1000ms
[10:35:18] [Unknown channel: Channel name 'ptyHost' timed out after 1000ms]
[10:35:21] No ptyHost response to createProcess after 5 seconds

Screenshot/Video

codeserver

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

Terminal is fine on code-server@4.5.2.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
horanchikkcommented, Aug 27, 2022

same

3reactions
kawanakaikucommented, Sep 8, 2022

I managed to make the terminal work. That error is due to process.platform returning android.

sed -i -e 's|switch(process.platform)|switch("linux")|' /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js
Read more comments on GitHub >

github_iconTop Results From Across the Web

Recover a broken environment - Termux Wiki
If Termux exits immediately after launch or cannot properly start shell, it is likely that your environment is broken. The cause of which...
Read more >
How to fix Termux error(not working) | August 2021 - YouTube
Hi viewers, A lot of people were asking me the wanted to use terminal but they don't have a PC so I decided...
Read more >
how to fix unable to locate package in termux
Termux provides a nifty way to execute basic and advanced linux commands, which is not possible on terminal emul. Published 2021/05.
Read more >
Termux - Apps on Google Play
NOTE: If you're having issues with installing or updating packages - see https://github.com/termux/termux-packages/wiki/Package-Management
Read more >
Why pip throwing an error when installing numpy in Termux?
When I run pip install numpy --no-cache-dir , the error was: ... What's more Numpy had been working for me on Termux for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found