Bug: Stdin piping breaks UI
Description
I was very happy to finally see the piping feature landing via f5015017911c81c6d89d0a3dcdbe475b948c6829 so I immediately tried. 😊
OpenCode version
1.0.20
Steps to reproduce
Use stdout pipe
- echo Hi | opencode
- Breaks
Screenshot and/or share link
oof
Operating System
macOS Sequoia 15.6.1 arm64
Terminal
Ghostty 1.3.0-main+3f75c66e8
I guess it was breaking before and it still breaks
it does work fine with; echo 'Hi' | opencode run
the easy fix would probably be to add this error log; Cannot run TUI with piped input. Use 'opencode run' instead: echo 'Hi' | opencode run
Might be relevant: https://stackoverflow.com/questions/6868296/whats-the-difference-between-stdin-and-tty-at-all
tldr: if user wants to maintain TUI but also pipe in some data, app must open /dev/tty and read from that
i see it’s already assigned, but i’d like to help or take over if that’s okay. @kommander
@kunaljaykam Sorry I started working on this before I saw your comment. I think I saved you a bit of headache tho.
Same issue here.
- Alacritty
- Arch Linux (omarchy)