Fix app run panic when stdin isn't a terminal#632
Conversation
console.Current() panics when there's no TTY, which means `miren app run` blows up over non-interactive SSH sessions or piped input. Switch to ConsoleFromFile(os.Stdin), which returns an error instead of panicking, matching what sandbox exec already does.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change modifies the console acquisition logic in the app run command. Instead of directly checking Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
miren app runwas usingconsole.Current()to grab a terminal handle, but that function panics when stdin isn't a TTY — so any non-interactive use (piped input, non-interactive SSH, CI) would blow up. The sibling commandsandbox execalready handled this correctly by usingconsole.ConsoleFromFile(os.Stdin), which returns an error instead of panicking and lets the else branch fall through to raw stdin/stdout.One-line fix to match the existing pattern. The server side already does the right thing — it only sets
proc.Terminal = truewhenWinSizeis present, which only gets set in the TTY branch.Closes MIR-714