Visitar URL original
Avoid terminal queries in captured tasty output by felixonmars · Pull Request #6 · merijn/paramtree · GitHub
Skip to content

Avoid terminal queries in captured tasty output - #6

Open
felixonmars wants to merge 1 commit into
merijn:masterfrom
felixonmars:patch-1
Open

felixonmars wants to merge 1 commit into
merijn:masterfrom
felixonmars:patch-1

Conversation

@felixonmars

Copy link
Copy Markdown

withCapturedIO redirects stdout to a temporary file while leaving stdin attached to the caller's terminal. Starting with tasty 1.5.4, the console reporter computes the terminal width when stdin is a terminal; ansi-terminal may do that by writing a cursor-position query to stdout. Because stdout is captured here, those escape bytes become part of the golden output.

Redirect stdin to the same non-terminal temporary file while the action runs, then restore both standard handles afterwards.

Fixes #5

withCapturedIO redirects stdout to a temporary file while leaving stdin attached to the caller's terminal. Starting with tasty 1.5.4, the console reporter computes the terminal width when stdin is a terminal; ansi-terminal may do that by writing a cursor-position query to stdout. Because stdout is captured here, those escape bytes become part of the golden output.

Redirect stdin to the same non-terminal temporary file while the action runs, then restore both standard handles afterwards.

Fixes merijn#5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure with GHC 9.14

1 participant