fix(tui): Prompt from stdin breaks TUI
Closes #3871.
I also reverted to the behavior from v0.15.x where the resulting prompt is args.prompt + stdin, whereas in v1.x it is currently stdin + args.prompt.
@kunaljaykam yw. What's missing is windows support, which I tried to add but doesn't work. I don't have a windows setup rn so I asked @rekram1-node to implement it. If you have a windows setup and are willing to help out, i think @rekram1-node would appreciate it.
@rekram1-node In any case, I think this PR is good to merge since it works for linux and doesn't break anything that wasn't already broken on windows (after reverting https://github.com/sst/opencode/pull/3930/commits/53dc493b4afd0c604700a10b6b01f57986c339b1)
i don’t have a windows setup, but you can spin up a windows instance on aws or azure and test it there using windows terminal.
I tested this on window and I try doing a special case using the //./con instead of /dev/tty but I got nowhere, the interfaces are different, I tried to hack and I got an state that opencode would not break but then the data wasn't going trhu at all.
If some of you have any ideas, I can try and test it