Bad experience installing OpenCode for Windows
Description
Lots of bugs:
- "curl -fsSL https://opencode.ai/install | bash" won't run in powershell (but do work in old windows command promot)
- "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)
- 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
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.
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.
~~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
the windows character bug is unrelated to install and we have someone working on it
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 wdym by ctrl+c to navigate?
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 :)))
Oh that's good to know I'm windows ignorant, thanks!
@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).