rich icon indicating copy to clipboard operation
rich copied to clipboard

Fix: Make Console follow FileProxy redirections

Open dp-alvarez opened this issue 1 year ago • 1 comments

Type of changes

  • [x] Bug fix
  • [ ] New feature
  • [ ] Documentation / docstrings
  • [x] Tests
  • [ ] Other

Checklist

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

Description

Currently, Live console redirection features only work when using the same Console that Live was created with, or with standard Python print(). This patch makes Console.print respect Live redirections across different Console instances. The most immediate use case is making stdlib logging work with redirections, but should also be useful in other scenarios. PS: The LLM-generated PR spam is very real on this repo, what a pain.

dp-alvarez avatar Apr 24 '25 02:04 dp-alvarez

@willmcgugan do you have any feedback on this? I'd love to get rid of hacky workarounds I have in my projects.

dp-alvarez avatar May 13 '25 22:05 dp-alvarez