-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Rerun tests using "r" key in watch mode #658
Conversation
By analyzing the blame information on this pull request, we identified @sotojuan, @ivogabe and @jokeyrhyme to be potential reviewers |
if (data !== 'r' && data !== 'rs') { | ||
stdin.on('keypress', function (char, key) { | ||
if (key.ctrl && key.name === 'c') { | ||
process.exit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.exit(2);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 (why 2
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Control-C is fatal error signal 2, (130 = 128 + 2, see above)
http://tldp.org/LDP/abs/html/exitcodes.html
I've seen 2
used many times for SIGINT overrides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thx!
56078f3
to
b0e44d8
Compare
b0e44d8
to
5f109b6
Compare
Rerun tests using "r" key in watch mode
Sorry didn't have a chance earlier to play with this. I have some concerns around the keyboard interaction. For instance if you run the watcher through npm (say
I suppose we could switch to a |
Do people actually use those?
Agreed. That is a problem. Is there a way to 1) detect if you have a parent process, and 2) send a SIGINT to it? I would rather not exit with Aside: It would be really nice if
I guess that depends on what those behaviors are, and what problems we are creating for users. If it creates real problems, lets just revert to the One last thought. I believe the original |
Never used either personally.
Couldn't agree more! The npm CLI generally has pretty awful UX. Related issue: npm/npm#8821 (Please comment there!)
The irony is that usually it is a problem with npm even when they output that. So the usual flow is a user opening an issue on one of my repos, I have to waste time triaging, and just send them back to the npm issue tracker... |
They can be useful when the app has trapped the
Not sure. I don't think the exit code matters all that much when in watch mode though.
Yes, see remy/nodemon#162 (comment). Also:
Not sure how much this impacts us, it might be due to how the child processes are forked. |
Just learned about (Not that it's very useful, it just outputs stuff like |
I guess we should rollback this PR and just rerun via r + Enter. Will be easier for everyone and additional "Enter" is not big a deal. |
Argument for keeping this: We can change this back at any point. It's not going to break builds. People are just going to have to retrain "r" vs "r + enter". For all the problems we've listed, I haven't seen one I think is a practical problem yet. Argument for reverting: It's the "safer" option. Guaranteed not to cause problems (however unlikely problems seem). If anyone can describe a situation where this prevents you from using watch mode then let's revert. Heck, I would be convinced if just one person said "I frequently use |
Even if we don't revert we need to fix the exit code upon I'm for reverting though, seems like an uphill battle trying to solve the various edge cases when they surface. |
Oh yeah, forgot about that. I don't love the idea of exiting with I think I'm convinced. Let's revert. @sindresorhus @vdemedes ? |
I'm for reverting, one less thing to maintain. Didn't think such a simple PR would have such complications afterwards :) |
Ok, let's revert to R+Enter. I don't think people will need it that often anyways. Our dependency tracking is pretty good. |
This reverts commit 5f109b6. See discussion in <#658 (comment)>.
This PR fixes #615.