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

Make bypassing capture context-aware #447

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexhall
Copy link

@alexhall alexhall commented Sep 13, 2024

This change makes the capture/bypass macro aware of the capture context in which it's running, so that it can more intelligently restore previous out/err writers (or just pass through if no capturing is active).

Unsupported corner cases:

  • Nested capturing (will write to the next level up, not the original out/err)
  • Code running on other threads where bindings weren't conveyed (will still write to the redef'ed out/err)

If this approach looks sensible, I'm happy to clean up the code, add tests, etc.

Fixes #446

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.

Bypassing capture-output has unexpected behavior when running in REPL
1 participant