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

Improve REPL KI #3030

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

richardsheridan
Copy link
Contributor

This commit has a draft method to fix #3007. I have 0 ideas on how to test this thing: not only does it use the raw_input that gets patched for testing, but the way it injects a newline is basically impossible for a test runner to pass in. Also, it feels fragile somehow to dip in and out of the trio loop patching the signal handler and peeking for KeyboardInterrupt.

@richardsheridan richardsheridan marked this pull request as draft July 5, 2024 23:08
Copy link

codecov bot commented Jul 5, 2024

Codecov Report

Attention: Patch coverage is 68.18182% with 7 lines in your changes missing coverage. Please review.

Project coverage is 99.59%. Comparing base (563f685) to head (39d0ca2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3030      +/-   ##
==========================================
- Coverage   99.63%   99.59%   -0.04%     
==========================================
  Files         120      120              
  Lines       17830    17852      +22     
  Branches     3204     3207       +3     
==========================================
+ Hits        17765    17780      +15     
- Misses         46       52       +6     
- Partials       19       20       +1     
Files Coverage Δ
src/trio/_repl.py 89.39% <68.18%> (-10.61%) ⬇️

@A5rocks
Copy link
Contributor

A5rocks commented Jul 10, 2024

Could we spawn the REPL as another process and send it a signal? (simulate ctrl+c)

I think we could first send it some data over stdin to get into specific scenarios.

@richardsheridan
Copy link
Contributor Author

The newline is sent to the terminal I think, rather than any specific process.

Potentially we could avoid the ioctl weirdness by allowing a small amount of user discomfort in needing to press enter after Ctrl+C.

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.

Ctrl+C behavior problems at the new REPL
2 participants