shelldoc reads command output line-by-line. If the final (or only) line if output is not terminated by \n, shelldoc blocks indefinitely waiting for the line terminator and eventually times out with ERROR: command execution timed out FAIL (timeout).
This affects any command that writes a bare value without a trailing newline. Two confirmed cases:
- kubectl … -o jsonpath='{.field}' — emits the field value with no \n
- curl -sf — when the response body is a bare JSON primitive such as true (4 bytes, no \n)
To reproduce:
$ printf 'no newline here'
no newline here
shelldoc times out after 5 seconds despite the expected output matching.
Workaround: append ; echo to the command in the exercise markdown (or in the Makefile target it calls) to guarantee a trailing newline.
Expected behaviour: shelldoc should treat EOF on the command's stdout as an implicit line terminator, flushing any buffered partial line as a complete output line.
shelldoc reads command output line-by-line. If the final (or only) line if output is not terminated by \n, shelldoc blocks indefinitely waiting for the line terminator and eventually times out with ERROR: command execution timed out FAIL (timeout).
This affects any command that writes a bare value without a trailing newline. Two confirmed cases:
To reproduce:
shelldoc times out after 5 seconds despite the expected output matching.
Workaround: append ; echo to the command in the exercise markdown (or in the Makefile target it calls) to guarantee a trailing newline.
Expected behaviour: shelldoc should treat EOF on the command's stdout as an implicit line terminator, flushing any buffered partial line as a complete output line.