opencode icon indicating copy to clipboard operation
opencode copied to clipboard

OpenCode freezes with black screen in Termux proot-distro Ubuntu, cannot exit with Ctrl+C

Open jyduyfcjufi opened this issue 3 weeks ago • 20 comments

When running OpenCode in a Ubuntu environment installed via proot-distro in Termux, the application displays a black screen and completely freezes, unable to exit with Ctrl+C.

Steps to Reproduce:

  1. Install proot-distro in Termux
  2. Install Ubuntu: proot-distro install ubuntu
  3. Enter Ubuntu: proot-distro login ubuntu
  4. Install opencode
  5. Run opencode
  6. The application shows a black screen with no content
  7. Pressing Ctrl+C has no response, must use kill command to force terminate

Expected Behavior: Should display a normal terminal interface.

Actual Behavior:

  • Black screen with no display
  • Cannot exit with Ctrl+C
  • Must force kill the process

jyduyfcjufi avatar Jan 16 '26 20:01 jyduyfcjufi

This issue might be a duplicate of or related to existing issues. Please check:

  • #8620: [Regression] v1.1.21 OpenTUI fails to initialize in Termux/PRoot (ARM64) - Similar environment (Termux/PRoot) with initialization failures
  • #7960: OpenCode CLI Critical Runtime Failure - Bun's bunfs compatibility issues in PRoot environments
  • #7843: [Critical] CLI hangs on second run (Deadlock) on Linux ARM64 (Proot/Container environments) - Similar freezing/hanging on ARM64 Proot
  • #7472: OpenCode crashes with "Aborted" on Termux/Debian on second attempt - Similar Termux environment issues
  • #6080: OpenCode TUI Hangs on Fedora Linux - Similar TUI freezing/hanging issues
  • #5361: TUI freezes for ~10 seconds periodically on WSL2 - Similar freezing patterns in virtualized environments

Feel free to ignore if this specific case (black screen + Ctrl+C unresponsiveness in proot-distro Ubuntu) is distinctly different from these issues.

github-actions[bot] avatar Jan 16 '26 20:01 github-actions[bot]

Are you using any plugins?

rekram1-node avatar Jan 16 '26 20:01 rekram1-node

No, I'm not using any plugins. This happens with a fresh installation of OpenCode in the proot-distro Ubuntu environment without any additional plugins or configurations.> Are you using any plugins?

jyduyfcjufi avatar Jan 16 '26 20:01 jyduyfcjufi

Same problem, no plugins installed. Everything was working fine a few days ago.

maxjust avatar Jan 16 '26 20:01 maxjust

LOG maybe helpful for diagnostic

installed @opencode-ai/[email protected]

[16.00ms] done
 stderr=Saved lockfile

INFO  2026-01-16T20:55:28 +441ms service=bus type=* subscribing
INFO  2026-01-16T20:55:28 +0ms service=bus type=session.updated subscribing
INFO  2026-01-16T20:55:28 +0ms service=bus type=message.updated subscribing
INFO  2026-01-16T20:55:28 +0ms service=bus type=message.part.updated subscribing
INFO  2026-01-16T20:55:28 +1ms service=bus type=session.updated subscribing
INFO  2026-01-16T20:55:28 +0ms service=bus type=message.updated subscribing
INFO  2026-01-16T20:55:28 +0ms service=bus type=message.part.updated subscribing
INFO  2026-01-16T20:55:28 +0ms service=bus type=session.diff subscribing
INFO  2026-01-16T20:55:28 +0ms service=format init
INFO  2026-01-16T20:55:28 +0ms service=bus type=file.edited subscribing
INFO  2026-01-16T20:55:28 +0ms service=lsp serverIds=deno, typescript, vue, eslint, oxlint, biome, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, fsharp, sourcekit-lsp, rust, clangd, svelte, astro, jdtls, kotlin-ls, yaml-ls, lua-ls, php intelephense, prisma, dart, ocaml-lsp, bash, terraform, texlab, dockerfile, gleam, clojure-lsp, nixd, tinymist, haskell-language-server enabled LSP servers
INFO  2026-01-16T20:55:28 +0ms service=file.watcher init
INFO  2026-01-16T20:55:28 +2ms service=bus type=command.executed subscribing
INFO  2026-01-16T20:55:28 +0ms service=file.watcher platform=linux backend=inotify watcher backend
INFO  2026-01-16T20:55:28 +2ms service=server event connected
INFO  2026-01-16T20:55:28 +0ms service=bus type=* subscribing
INFO  2026-01-16T20:55:28 +1ms service=server status=started providers
INFO  2026-01-16T20:55:28 +1ms service=provider status=started state
INFO  2026-01-16T20:55:28 +3ms service=models.dev file={} refreshing
INFO  2026-01-16T20:55:28 +0ms service=models.dev file={} refreshing
INFO  2026-01-16T20:55:28 +1ms service=server status=completed duration=679 method=GET path=/event request
INFO  2026-01-16T20:55:28 +0ms service=server status=completed duration=678 method=GET path=/config request
INFO  2026-01-16T20:55:28 +1ms service=server status=completed duration=679 method=GET path=/agent request
INFO  2026-01-16T20:55:28 +2ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)

Checked 8 installs across 16 packages (no changes) [6.00ms]
 stderr= done
INFO  2026-01-16T20:55:28 +0ms service=vcs branch=develop initialized
INFO  2026-01-16T20:55:28 +0ms service=bus type=file.watcher.updated subscribing
INFO  2026-01-16T20:55:28 +24ms service=server status=completed duration=705 method=GET path=/session request
ERROR 2026-01-16T20:55:38 +9975ms service=default e=The operation timed out. rejection
ERROR 2026-01-16T20:55:38 +0ms service=default e=The operation timed out. rejection

maxjust avatar Jan 16 '26 20:01 maxjust

hmm

rekram1-node avatar Jan 16 '26 21:01 rekram1-node

if u do BUN_BE_BUN=1 opencode --version what do u see?

rekram1-node avatar Jan 16 '26 21:01 rekram1-node

BUN_BE_BUN=1 opencode --version 2026 M01 17, Sat 00:27:38 1.3.5

if u do BUN_BE_BUN=1 opencode --version what do u see?

maxjust avatar Jan 16 '26 21:01 maxjust

Does OpenCode require an internet connection to work properly if local LLM are used?

maxjust avatar Jan 16 '26 21:01 maxjust

Well there is one thing that could yeah, it automatically installs a small js package that is shipped w/ opencode so that any plugins or custom tools can be resolved properly, need to have an airgapped method to prevent that need

rekram1-node avatar Jan 16 '26 21:01 rekram1-node

version 1.1.15 working well, but 1.1.24 don't

Image

maxjust avatar Jan 16 '26 21:01 maxjust

1.1.25 din't resolve issue, problem still exist

maxjust avatar Jan 16 '26 23:01 maxjust

yes

jyduyfcjufi avatar Jan 17 '26 03:01 jyduyfcjufi

can i see full output of opencode run hello --print-logs

?

rekram1-node avatar Jan 17 '26 04:01 rekram1-node

root@localhost:~# opencode run hello --print-logs                                         
INFO  2026-01-17T04:45:17 +287ms service=default version=1.1.25 args=["run","hello","--print-logs"] opencode                           INFO  2026-01-17T04:45:17 +0ms service=default directory=/root creating instance          
INFO  2026-01-17T04:45:17 +0ms service=project directory=/root fromDirectory              
INFO  2026-01-17T04:45:17 +9ms service=default directory=/root bootstrapping             
 INFO  2026-01-17T04:45:17 +2ms service=config path=/root/.config/opencode/config.json loading                                          
INFO  2026-01-17T04:45:17 +1ms service=config path=/root/.config/opencode/opencode.json loading                                        INFO  2026-01-17T04:45:17 +1ms service=config path=/root/.config/opencode/opencode.jsonc loading                                       INFO  2026-01-17T04:45:17 +46ms service=bun cmd=["/root/.opencode/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/root/.config/opencode running                    INFO  2026-01-17T04:45:21 +3504ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)                                                  installed @opencode-ai/[email protected]                                                      [7.00ms] done                                 stderr=Saved lockfile                        done                                        INFO  2026-01-17T04:45:21 +0ms service=bun cmd=["/root/.opencode/bin/opencode","install"] cwd=/root/.config/opencode running          
INFO  2026-01-17T04:45:25 +3851ms service=config path=/root/.opencode/opencode.jsonc loading                                           INFO  2026-01-17T04:45:25 +46ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)                                                Checked 3 installs across 4 packages (no changes) [7.00ms]                                 stderr= done                               
 INFO  2026-01-17T04:45:25 +8ms service=config path=/root/.opencode/opencode.json loading  INFO  2026-01-17T04:45:25 +1ms service=bun cmd=["/root/.opencode/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/root/.opencode running                            INFO  2026-01-17T04:45:29 +3946ms service=plugin name=CodexAuthPlugin loading internal plugin                                          INFO  2026-01-17T04:45:29 +0ms service=plugin name=CopilotAuthPlugin loading internal plugin                                           INFO  2026-01-17T04:45:29 +0ms service=plugin [email protected] loading plugin                                        INFO  2026-01-17T04:45:29 +1ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)                                                     installed @opencode-ai/[email protected]                                                      3 packages installed [24.00ms]                stderr=Saved lockfile                        done                                        INFO  2026-01-17T04:45:29 +0ms service=bun cmd=["/root/.opencode/bin/opencode","install"] cwd=/root/.opencode running                 
 INFO  2026-01-17T04:45:33 +4069ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)                                              + @opencode-ai/[email protected]                                                              3 packages installed [29.00ms]                stderr= done                                
ERROR 2026-01-17T04:45:33 +33ms service=default name=ResolveMessage message=Cannot find module '/root/.cache/opencode/node_modules/opencode-anthropic-auth' from '/$bunfs/root/src/index.js' code=ERR_MODULE_NOT_FOUND specifier=/root/.cache/opencode/node_modules/opencode-anthropic-auth referrer=/$bunfs/root/src/index.js importKind=import-statement fatal        Error: Unexpected error, check log file at  for more details                                                                           ResolveMessage: Cannot find module '/root/.cache/opencode/node_modules/opencode-anthropic-auth' from '/$bunfs/root/src/index.js'

iceqing avatar Jan 17 '26 04:01 iceqing

can i see full output of opencode run hello --print-logs

?

opencode run hello --print-logs                                                                                              205ms  2026 M01 17, Sat 13:57:46
INFO  2026-01-17T10:57:50 +131ms service=default version=1.1.25 args=["run","hello","--print-logs"] opencode
INFO  2026-01-17T10:57:50 +0ms service=default directory=/home/max creating instance
INFO  2026-01-17T10:57:50 +1ms service=project directory=/home/max fromDirectory
INFO  2026-01-17T10:57:50 +2ms service=default directory=/home/max bootstrapping
INFO  2026-01-17T10:57:50 +2ms service=config path=/home/max/.config/opencode/config.json loading
INFO  2026-01-17T10:57:50 +0ms service=config path=/home/max/.config/opencode/opencode.json loading
INFO  2026-01-17T10:57:50 +0ms service=config path=/home/max/.config/opencode/opencode.jsonc loading
INFO  2026-01-17T10:57:50 +5ms service=bun cmd=["/home/max/.nvm/versions/node/v24.12.0/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/home/max/.config/opencode running
INFO  2026-01-17T10:57:50 +3ms service=plugin name=CodexAuthPlugin loading internal plugin
INFO  2026-01-17T10:57:50 +0ms service=plugin name=CopilotAuthPlugin loading internal plugin
INFO  2026-01-17T10:57:50 +0ms service=plugin [email protected] loading plugin
INFO  2026-01-17T10:57:50 +1ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)

installed @opencode-ai/[email protected]

[1.00ms] done
 stderr=Saved lockfile
 done
INFO  2026-01-17T10:57:50 +0ms service=bun cmd=["/home/max/.nvm/versions/node/v24.12.0/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","install"] cwd=/home/max/.config/opencode running
INFO  2026-01-17T10:57:50 +9ms service=plugin path=@gitlab/[email protected] loading plugin
INFO  2026-01-17T10:57:50 +1ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)

Checked 3 installs across 4 packages (no changes) [3.00ms]
 stderr= done
INFO  2026-01-17T10:57:50 +30ms service=bus type=* subscribing
INFO  2026-01-17T10:57:50 +0ms service=bus type=session.updated subscribing
INFO  2026-01-17T10:57:50 +0ms service=bus type=message.updated subscribing
INFO  2026-01-17T10:57:50 +0ms service=bus type=message.part.updated subscribing
INFO  2026-01-17T10:57:50 +0ms service=bus type=session.updated subscribing
INFO  2026-01-17T10:57:50 +0ms service=bus type=message.updated subscribing
INFO  2026-01-17T10:57:50 +0ms service=bus type=message.part.updated subscribing
INFO  2026-01-17T10:57:50 +0ms service=bus type=session.diff subscribing
INFO  2026-01-17T10:57:50 +1ms service=format init
INFO  2026-01-17T10:57:50 +0ms service=bus type=file.edited subscribing
INFO  2026-01-17T10:57:50 +0ms service=lsp serverIds=deno, typescript, vue, eslint, oxlint, biome, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, fsharp, sourcekit-lsp, rust, clangd, svelte, astro, jdtls, kotlin-ls, yaml-ls, lua-ls, php intelephense, prisma, dart, ocaml-lsp, bash, terraform, texlab, dockerfile, gleam, clojure-lsp, nixd, tinymist, haskell-language-server enabled LSP servers
INFO  2026-01-17T10:57:50 +0ms service=bus type=command.executed subscribing
INFO  2026-01-17T10:57:50 +9ms service=server method=POST path=/session request
INFO  2026-01-17T10:57:50 +0ms service=server status=started method=POST path=/session request
INFO  2026-01-17T10:57:50 +1ms service=session id=ses_43465535fffeGzhqZBu7vhEhfD slug=nimble-falcon version=1.1.25 projectID=global directory=/home/max title=New session - 2026-01-17T10:57:50.240Z time={"created":1768647470240,"updated":1768647470240} created
INFO  2026-01-17T10:57:50 +1ms service=bus type=session.created publishing
INFO  2026-01-17T10:57:50 +1ms service=bus type=session.updated publishing
INFO  2026-01-17T10:57:50 +1ms service=server status=completed duration=4 method=POST path=/session request
INFO  2026-01-17T10:57:50 +0ms service=server method=GET path=/config request
INFO  2026-01-17T10:57:50 +0ms service=server status=started method=GET path=/config request
INFO  2026-01-17T10:57:50 +0ms service=server status=completed duration=0 method=GET path=/config request
INFO  2026-01-17T10:57:50 +1ms service=server method=GET path=/event request
INFO  2026-01-17T10:57:50 +1ms service=server status=started method=GET path=/event request
INFO  2026-01-17T10:57:50 +0ms service=server method=POST path=/session/ses_43465535fffeGzhqZBu7vhEhfD/message request
INFO  2026-01-17T10:57:50 +0ms service=server status=started method=POST path=/session/ses_43465535fffeGzhqZBu7vhEhfD/message request
INFO  2026-01-17T10:57:50 +0ms service=server event connected
INFO  2026-01-17T10:57:50 +1ms service=bus type=* subscribing
INFO  2026-01-17T10:57:50 +2ms service=server status=completed duration=3 method=GET path=/event request
INFO  2026-01-17T10:57:50 +0ms service=server status=completed duration=3 method=POST path=/session/ses_43465535fffeGzhqZBu7vhEhfD/message request
INFO  2026-01-17T10:57:50 +5ms service=provider status=started state
INFO  2026-01-17T10:57:50 +1ms service=models.dev file={} refreshing
ERROR 2026-01-17T10:58:00 +10002ms service=default e=The operation timed out. rejection

maxjust avatar Jan 17 '26 10:01 maxjust

The network trace shows that I can't connect to the OP-code servers, even though I'm using a local LLM and the basic internet connection is fine. But the opencode website doesn't open in the browser. How can I run a fully local version?

maxjust avatar Jan 17 '26 11:01 maxjust