-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Add wait: false to options object for opn #5821
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
@W1lkins Out of interest, what happens if the browser is already open in Ubuntu (as it is now)? Does it still try to close the browser? |
@mrmckeb I've recorded some examples where I run a quick script: #!/bin/bash -e
echo -e "Ubuntu version $(head -n2 /etc/os-release)\\n"
echo -e "Chrome version: $(google-chrome-unstable --version)\\n"
echo -e "Yarn version: $(yarn --version)\\n"
echo -e "Value of options: $(sed -n 99p test-app/node_modules/react-dev-utils/openBrowser.js)\\n" (I now realise after recording I forgot to check Pre-PR behaviour with browser open: Pre-PR behaviour with browser closed: Post-PR behaviour with browser open: Post-PR behaviour with browser closed: As you can see in the old behaviour (Pre-PR behaviour with browser closed), without Hope this answers your query! |
Can we verify that this still works as expected on macOS and Windows? Also, can you rebase this branch with master so we can get the tests passing? |
I've tested both starting from no browser open and starting with the browser already open on: MacOS:
Windows:
|
Thanks! |
Fixes #3113.
As far as I can see, there is no downside to adding
{ wait: false }
to the option args when invoking opn, if someone can think of one then I'm happy to test that path.Adding
wait : false
addscpOpts.stdio = 'ignore';
andcpOpts.detached = true;
to thechildProcess.spawn
option object. see the relevant opn codeTesting on Ubuntu before the change:
<Ctrl>c
would also terminate the browser sessionAfter:
<Ctrl>c
does not terminate the browser session.This fixes #3113 for me on Ubuntu and causes no regressions on macOS Mojave (where I was unable to replicate the issue due to it not using
xdg-open
) Didn't get a chance to test on Windows so would be nice if someone else could give that a go.)