-
Notifications
You must be signed in to change notification settings - Fork 344
Suspend and Resume on TSTP and CONT signals #361 #514
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
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @jonleighton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
e9c6475
to
d722128
Compare
Is there any way we can write a test for this? |
I tried to find how the current signal handlers are being tested, and I wasn't able to find any existing tests for them, e.g. Spring::Client::Run::FORWARDED_SIGNALS. Are they someplace else? I don't have enough familiarity with how |
Yeah OK. I had thought there was some sort of similar test already, but I see that there's not. I agree it could be quite tricky to write a test for this. When I get a chance I'll do some manual testing and then merge your code. |
Any word on this? It's a really confusing experience when you Ctrl-Z and can't even get back because half of your keystrokes seem to go to your shell and half to ruby. Fortunately it's easy to manually patch |
d722128
to
5cd2a62
Compare
ctrl-z (SIGTSTP) doesn't work with Spring, and it corrupts the terminal as mentioned by @casper in Issue rails#361: > the spring server is somehow attached to the PTY of the shell the solution is to: > trap SIGTSTP and tell the server to disengage from the PTY > before the client process is suspended
5cd2a62
to
a9473e9
Compare
@jonleighton It's been a long time since this simple PR was first submitted. Can you take a look? I've rebased it on top of master without any additional changes. By the way, there's some nondeterminism in tests. For the same code: |
I came to the same conclusion about this just recently and had basically the same solution except I didn't realize the difference between Here's a gif showing the core ideas, though it's of my demo and not this PR: |
That's cool @JoshCheek |
Thanks for merging! Excited to have this available ^_^ |
ctrl-z (SIGTSTP) doesn't work with Spring, and it corrupts the terminal
as mentioned by @casper in Issue #361:
the solution is to: