Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Invalid Console Handle #28

Merged

Conversation

thomhurst
Copy link
Contributor

In some consoles, the output is redirected.

There's a call to ResetLineCore which moves the Console cursor, but this won't work on a redirected console.

A simple check around it to see if the console has been redirected fixes this, otherwise it throws an error.

I've added some tests, and I've also added a Windows agent github action dev build, as that's where I was seeing my issue.

Thanks

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #28 (d6e9c41) into dev (94ad7aa) will decrease coverage by 0.04%.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##              dev      #28      +/-   ##
==========================================
- Coverage   91.74%   91.70%   -0.04%     
==========================================
  Files          67       67              
  Lines        1951     1954       +3     
==========================================
+ Hits         1790     1792       +2     
- Misses        161      162       +1     
Flag Coverage Δ
unittests 91.70% <25.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/Output/ConsoleWriter.cs 57.14% <25.00%> (-42.86%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@daningalla daningalla merged commit 5467802 into verticalsoftware:dev Aug 24, 2023
2 of 4 checks passed
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.

None yet

3 participants