gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.06k stars 122 forks source link

Improve warning message when stdin is not a terminal #374

Closed smoynes closed 12 months ago

smoynes commented 12 months ago

As discussed in a comment, update the warning message to be slightly more useful to the user by mentioning the impact of the error rather than just the cause.

Because go test captures Stderr & Stdout and redirects Stdin, it provides a handy repro. Without this change:

$ go test
Running tests in ./.
Watching 1 directories. Use Ctrl-c to to stop a run or exit.
WARN failed to put terminal (fd 0) into raw mode: operation not supported by device

With this change:

$ go test
Watching 1 directories. Use Ctrl-c to to stop a run or exit.
WARN no terminal input -- keyboard shortcuts disabled: operation not supported by device

I am happy to change the text if the maintainers can suggest better wording.

Refs: #370

🤵🏻