opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Bug: Stdin piping breaks UI

Open zenyr opened this issue 2 months ago • 5 comments

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

Image Image

oof

Operating System

macOS Sequoia 15.6.1 arm64

Terminal

Ghostty 1.3.0-main+3f75c66e8

zenyr avatar Nov 04 '25 06:11 zenyr

I guess it was breaking before and it still breaks

rekram1-node avatar Nov 04 '25 06:11 rekram1-node

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

kunaljaykam avatar Nov 04 '25 14:11 kunaljaykam

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

richard-hajek avatar Nov 04 '25 19:11 richard-hajek

i see it’s already assigned, but i’d like to help or take over if that’s okay. @kommander

kunaljaykam avatar Nov 05 '25 04:11 kunaljaykam

@kunaljaykam Sorry I started working on this before I saw your comment. I think I saved you a bit of headache tho.

veracioux avatar Nov 05 '25 08:11 veracioux

Same issue here.

  • Alacritty
  • Arch Linux (omarchy)

fabioalmeidaweb avatar Nov 05 '25 23:11 fabioalmeidaweb