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

Avoid losing focus #3

Closed
danhper opened this issue Aug 16, 2014 · 5 comments
Closed

Avoid losing focus #3

danhper opened this issue Aug 16, 2014 · 5 comments

Comments

@danhper
Copy link

danhper commented Aug 16, 2014

Hi,
I am using this module with Grunt to display errors in the browser
while coding. However, the focus (on the editor) is lost after opening the browser, which is not very handy.
It would be nice if there could be an option to disable this behavior, but I am not sure
how it could be implemented cross-platform. For OS X, passing -g to the open command
should be ok, but I cannot find any equivalent for xdg-open.
Any ideas?

@sindresorhus
Copy link
Owner

I couldn't find anything on xdg-open and opening unfocused, but you might be able to focus back to your terminal right after opening, using http://superuser.com/questions/142945/bash-command-to-focus-a-specific-window

@danhper
Copy link
Author

danhper commented Aug 17, 2014

Thanks for the answer, I'm going to check this out.
I'll close the issue for now, I'll send a PR if I manage to
write something possibly useful.

@danhper danhper closed this as completed Aug 17, 2014
@sunknudsen
Copy link
Contributor

@sindresorhus Would it be acceptable to implement a focus option that only works on Darwin to trigger cliArguments.push('-g');? I totally agree with @danhper that there are use cases where focusing a browser for instance isn’t optimal.

@sindresorhus
Copy link
Owner

Sure, PR welcome.

@sunknudsen
Copy link
Contributor

@sindresorhus PR is out. Didn’t bump the version in case you prefer to handle that. Thanks!

sindresorhus added a commit that referenced this issue Apr 7, 2019
Fixes #3

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
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

No branches or pull requests

3 participants