code-server: [Bug]: Terminal not working

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Arch Linux
  • Remote OS: Ubuntu
  • Remote Architecture: aarch64
  • code-server --version: 4.4.0

Steps to Reproduce

  1. open code-server
  2. open new termina

Expected

Terminal window should open.

Actual

Terminal window is blank.

Logs

[IPC Library: Pty Host] WARN Shell integration cannot be enabled for executable “/usr/bin/bash” and args undefined

[22:22:15] Terminal process launching on remote agent { shellLaunchConfig: { name: undefined, executable: ‘/usr/bin/bash’, args: undefined, cwd: ‘/root/sandbox/StatusPage’, env: undefined, useShellEnvironment: true },

Screenshot/Video

image

Does this issue happen in VS Code?

  • I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

I tried to reinstall code-server, and even I ran the docker version from linuxservers with the same results. It’s weird because 2 days ago it was working, and I didn’t update anything on that server.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 36 (16 by maintainers)

Most upvoted comments

I got watcher working by installing watchman(!) and using @parcel/watcher from pr https://github.com/parcel-bundler/watcher/pull/128 .

Steps:

  1. Install code-server
  2. Install dependencies: sudo npm i -g yazl yauzl @microsoft/1ds-core-js vscode-regexpp xterm-headless vscode-proxy-agent --unsafe-perm
  3. Link ripgrep: sudo pkg install ripgrep && cd /usr/local/lib/node_modules/@vscode/ripgrep/bin && ln -s /usr/local/bin/rg
  4. Install @parcel/watcher from pr https://github.com/parcel-bundler/watcher/pull/128: cd watcher && npm install && sudo cp build/Release/watcher.node /usr/local/lib/node_modules/@parcel/watcher/build/Release/
  5. Workaround Platform not supported by editing: sudo vim /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js, pretending freebsd as linux
  6. Use workaround in https://github.com/coder/code-server/issues/5760:
sudo pkg install libsecret pkgconf
cd /usr/local/lib/node_modules/code-server
sudo npm install --unsafe-perm
# go back to @parcel/watcher
cd watcher
sudo cp build/Release/watcher.node /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/@parcel/watcher/build/Release

Eventually got terminal, searching, watchers working.

That’s helpful! Do you remember which flag it was?

If I remember correctly, something with canvas. I can check that in about 3 hours.

Everything appears to be working for me!

image

I hope we’re right then 🤞🏼 Hoping to get 4.5.1 out soon. Sorry for all the trouble!

I’m having same issue on FreeBSD. Terminal does not work. Some languages, like Python, there is no syntax highlighting but JavaScript is highlighted correctly. The errors from the code-server server on FreeBSD 13.1 and code-server v4.7.1 look like:

[20:42:29] ptyHost was unable to resolve shell environment Error: Unable to resolve your shell environment: Unexpected exit code from spawned shell (code 1, signal null)
...
[20:45: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

Also, when installed on FreeBSD via npm, I keep getting missing module errors after starting code-server. I had to keep killing/restarting to install the packages it was asking for until I stopped getting those errors. I ended having to manually install: npm i yazl yauzl @microsoft/1ds-core-js vscode-regexpp xterm-headless vscode-proxy-agent

Maybe due to that the ‘@parcel/watcher’ package does not support FreeBSD.

Hmm…any ideas for ways we can fix that? Would it be worth raising upstream?

[IPC Library: File Watcher] Loading "@parcel/watcher" failed [IPC Library: File Watcher] Error: /usr/local/lib/node_modules/@parcel/watcher/build/Release/watcher.node: Undefined symbol "_ZTV17BruteForceBackend" 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 (/usr/local/lib/node_modules/@parcel/watcher/node_modules/node-gyp-build/index.js:22:10) at Object.<anonymous> (/usr/local/lib/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 (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101) at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1720) at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005) at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302) at Object.errorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10423) at e.triggerErrorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11369) at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11075 at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1737) at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005) at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302) at o._loadModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10432) at o._resolve (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452) at o.defineModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144) at y (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825) at h (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554) at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/platform/files/node/watcher/watcherMain.js:14:21897) at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/platform/files/node/watcher/watcherMain.js:14:33421) at e._createAndEvalScript (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598) at /usr/local/lib/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' ] [11:03:49] [192.168.98.1][1b00a7cd][ExtensionHostConnection] New connection established. [11:03:49] [192.168.98.1][1b00a7cd][ExtensionHostConnection] <894> Launched Extension Host Process. File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/vscode-textmate/release/main.js File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/vscode-oniguruma/release/onig.wasm File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/vscode-oniguruma/release/main.js File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/xterm/lib/xterm.js

@parcel/watcher

I have no idea how to fix it by now. Maybe raising upstream is viable. Otherwise, just disable the terminal on FreeBSD, or else it may lead to high CPU usage.

My problem was in configuration of flags in chrome, so i think that wasn’t code-server bug.

@consideRatio I would bet so! CI just finished and now i’m testing 4.5.1 (what we’ll publish) locally. I’ll run it behind Caddy and check syntax highlighting now. Thanks for mentioning it!

@jsjoeio I had the same issue today after upgrade code-server from 4.4.0 to 4.5.0 and I don’t use ‘coder’.

The background steps for the upgrade:

  1. Using code-server 4.40 ssh forward with chrome + safari on client side
  2. Install script upgrade failed on rpm
  3. Manually run rpm -U --replacefiles --replacepkgs ~/.cache/code-server/code-server-4.5.0-amd64.rpm
  4. Restart service

I could open more terminals, but I didn’t see the content and titles of the terminals and otherwise exactly as the description/screenshot.

Likewise, I think it was caused by browser some cache or cookies. Because after I returned from a few local errands, the problem magically resolved itself. I had problem on client node with Safari and Chrome, server side RHEL 8.6, logs from the systemd coda-server service are clean, and I can’t give you any more information backwards from the browsers, unfortunately.

New installation 4.4.0, Ubuntu 20.04 on arm64,

“The terminal process failed to launch: A native exception occurred during launch (forkpty(3) failed.).”

[IPC Library: Pty Host] WARN Shell integration cannot be enabled for executable “/bin/bash” and args []

It appears that my issue appears with code-server is run from a chroot/jailkit account. Seems to work fine on a regular user; non-root account on Ubuntu. Wondering if it’s a missing dependency issue of something simply not copied over to the jailed account.