Bug: Stdin piping breaks UI #2562

Open
opened 2026-02-16 17:36:13 -05:00 by yindo · 6 comments
Owner

Originally created by @zenyr on GitHub (Nov 4, 2025).

Originally assigned to: @kommander on GitHub.

Description

I was very happy to finally see the piping feature landing via f501501791 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

Originally created by @zenyr on GitHub (Nov 4, 2025). Originally assigned to: @kommander on GitHub. ### 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 <img width="947" height="640" alt="Image" src="https://github.com/user-attachments/assets/9f0c4fb9-fc6a-4749-889b-e9c5fa204f0b" /> <img width="1852" height="1021" alt="Image" src="https://github.com/user-attachments/assets/da68bb00-2e33-4d04-818e-fcfe856742b6" /> > oof ### Operating System macOS Sequoia 15.6.1 arm64 ### Terminal Ghostty 1.3.0-main+3f75c66e8
yindo added the opentuibug labels 2026-02-16 17:36:13 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 4, 2025):

I guess it was breaking before and it still breaks

@rekram1-node commented on GitHub (Nov 4, 2025): I guess it was breaking before and it still breaks
Author
Owner

@kunaljaykam commented on GitHub (Nov 4, 2025):

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 commented on GitHub (Nov 4, 2025): 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`
Author
Owner

@richard-hajek commented on GitHub (Nov 4, 2025):

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 commented on GitHub (Nov 4, 2025): 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
Author
Owner

@kunaljaykam commented on GitHub (Nov 4, 2025):

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

@kunaljaykam commented on GitHub (Nov 4, 2025): i see it’s already assigned, but i’d like to help or take over if that’s okay. @kommander
Author
Owner

@veracioux commented on GitHub (Nov 5, 2025):

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

@veracioux commented on GitHub (Nov 5, 2025): @kunaljaykam Sorry I started working on this before I saw your comment. I think I saved you a bit of headache tho.
Author
Owner

@fabioalmeidaweb commented on GitHub (Nov 5, 2025):

Same issue here.

  • Alacritty
  • Arch Linux (omarchy)
@fabioalmeidaweb commented on GitHub (Nov 5, 2025): Same issue here. - Alacritty - Arch Linux (omarchy)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2562