opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Bad experience installing OpenCode for Windows

Open mmc41 opened this issue 1 week ago • 8 comments

Description

Lots of bugs:

  1. "curl -fsSL https://opencode.ai/install | bash" won't run in powershell (but do work in old windows command promot)
  2. "curl -fsSL https://opencode.ai/install | bash" installs opencode inside WSL - not in windows. Get "opencode" not found if run inside windows command prompt or poweshell (I had to install using npm instead to get it working in Windows)
  3. Exiting a running opencode with Ctrl-C does not work. The console app close and the user gets back ito the shell but opencode still runs and outputs strange characters into the shell.

OpenCode version

No response

Steps to reproduce

Install on windows 11 PC as outlined above.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

mmc41 avatar Dec 13 '25 10:12 mmc41

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

  • #5223: Can't open opencode after install (Windows 11 installation issues)
  • #2999: Provide means to disable Ctrl-C (Ctrl-C handling on Windows causing crashes)
  • #3343: Cannot paste multiple lines in Windows Terminal and VSCode+Powershell (Windows Terminal/PowerShell issues)
  • #5121: Winget installation option for windows (Alternative Windows installation method)

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Dec 13 '25 10:12 github-actions[bot]

EDIT DISREGARD, THE BELOW WASA FOR PS7 in WINDOWS NOT WSL

For PowerShell, I was doing: winget install OpenJS.NodeJS.LTS npm install -g opencode-ai

Working great on one machine - on another: panic(main thread): Segmentation fault at address 0x3 oh no: Bun has crashed; This indicates a bug in Bun, not your code - after any commands

Fixed:

  • winget remove OpenJS.NodeJS.LTS
  • install official nodejs from nodejs.org
  • npm version after that was: npm --version: 11.6.2
  • npm install -g opencode-ai

Everything seems to be working fine on the 2nd install now.

johnem-msft avatar Dec 13 '25 15:12 johnem-msft

~~I mean curl install wont work in powershell ever right? Maybe it works it you are using git bash but it isnt for powershell.~~

edit: nvm

rekram1-node avatar Dec 13 '25 16:12 rekram1-node

the windows character bug is unrelated to install and we have someone working on it

rekram1-node avatar Dec 13 '25 16:12 rekram1-node

Similar experience it is especially annoying coming from Claude code where I used ctrl+c to navigate all the time. I really appreciate your work though most of it is great.

jrgleason avatar Dec 17 '25 20:12 jrgleason

@jrgleason wdym by ctrl+c to navigate?

rekram1-node avatar Dec 17 '25 21:12 rekram1-node

I mean curl install wont work in powershell ever right? Maybe it works it you are using git bash but it isnt for powershell.

Curl works fine in PowerShell

In PS 5 it's an alias for Invoke-WebRequest per get-alias curl curl -> Invoke-WebRequest

In PS 7 curl is redesigned and works like regular curl in bash - eg: curl -L aka.ms/whatsmyip

So ... for any "Windows" scenarios here it's important to understand if we are in WSL (v1/v2?) or PS5 or PS7

$psversiontable (echo $psversiontable if you wish)

@mmc41 it would be good if you could tell us more about your environment.

Taking a closer look - I see you are piping to bash ... it seems like this is Linux/WSL and not particularly "Windows"?

What do we have for? cat /etc/rel

In PowerShell - what do you have for: wsl --version?

Note - I installed via the method you described fine in Ubuntu22/WSL2 and it works great WSL version: 2.6.3.0

Note2: Opencode works fine in PS7 w. NodeJS installed :)))

johnem-msft avatar Dec 18 '25 19:12 johnem-msft

Oh that's good to know I'm windows ignorant, thanks!

rekram1-node avatar Dec 18 '25 20:12 rekram1-node

@johnem-msft I am using PowerShell 7.5.4 on Windows 11 @rekram1-node Thanks for looking at this.

I should add a general note, that I see it as critical for user adoption of any software, that a) That the software can be installed - I.e. The install instructions work: Failed - Some the of instructions on "https://opencode.ai/" does not work on windows, so the instructions need to be changed (perhaps be made OS dependent). b) That the software can start - OK! Good! c) That the software work reasonable well - ? (have not tried enough to be sure yet). d) That the software can be stopped: Failed (Ctrl-C does not work on Windows).

mmc41 avatar Dec 19 '25 08:12 mmc41