CLI tool hung on stdin despite full prompt argument; redirecting /dev/null fixed it
A developer encountered an indefinite hang while calling a CLI review tool from a script, despite passing the entire prompt as a command-line argument. The tool printed 'Reading additional input from stdin...' and then stalled, because it treats argument-based prompts and stdin as two separate, non-exclusive input channels. In the script's shell environment, stdin never received an EOF signal automatically, leaving the process waiting indefinitely. Redirecting stdin from /dev/null using '< /dev/null' forced an immediate EOF, allowing the tool to complete and exit normally in the foreground. The fix was confirmed across two separate test runs with different prompts, though the author notes the behavior may differ in shell environments that close stdin automatically.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in