Skip to content

Handle recording on legacy mode Windows consoles#2066

Merged
willmcgugan merged 11 commits intomasterfrom
windows-capture-fix
Mar 18, 2022
Merged

Handle recording on legacy mode Windows consoles#2066
willmcgugan merged 11 commits intomasterfrom
windows-capture-fix

Conversation

@darrenburns
Copy link
Member

@darrenburns darrenburns commented Mar 15, 2022

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Console.record=True was only being handled inside _render_buffer, which was not called on legacy mode consoles.

I've extracted the code for recording the buffer out of this method, to ensure it gets called regardless of environment.

Closes #2053

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.

Project coverage is 99.45%. Comparing base (e552771) to head (98969ab).
Report is 1384 commits behind head on master.

Files with missing lines Patch % Lines
rich/console.py 70.58% 5 Missing ⚠️
rich/segment.py 93.75% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2066      +/-   ##
==========================================
- Coverage   99.52%   99.45%   -0.07%     
==========================================
  Files          72       72              
  Lines        7335     7344       +9     
==========================================
+ Hits         7300     7304       +4     
- Misses         35       40       +5     
Flag Coverage Δ
unittests 99.45% <87.75%> (-0.07%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@darrenburns darrenburns requested a review from willmcgugan March 16, 2022 09:47
Copy link
Member

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@darrenburns
Copy link
Member Author

@willmcgugan pty module doesn't work on Windows. Has a comment at the top of it too saying it's only tested on Unix and MacOS.

@darrenburns darrenburns requested a review from willmcgugan March 17, 2022 11:02
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.

[BUG] Rich 12.0.0 fails to write to stdout attached to a pipe on Windows

3 participants