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
Use 'wslview' instead of 'xdg-open' on Windows #14822
Conversation
Review period will end on 2023-02-28 at 08:36:59 UTC. |
7689605
to
8a9e9af
Compare
Review period skipped due to |
Makes sense to me, thanks @maxim-belkin! Some |
8a9e9af
to
c9b289f
Compare
Thank you, Mike, for approving the pull request! |
@maxim-belkin some more |
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
dda83d7
to
2b008ae
Compare
Thanks again @maxim-belkin! |
Thanks for the review and feedback, Mike! |
@maxim-belkin, CC @MikeMcQuaid: A Linux distribution installed inside Windows Subsystem for Linux v2 isn't guaranteed not to have '
This kind of edge case might not be worth handling, at least not yet/at the moment, though? |
Oh, I wasn't aware of such setups. It shouldn't be difficult to check if wslview or xdg-open is available in WSL. |
@maxim-belkin Yeh, a follow-up PR to use |
Sure. We can do something like this (added "echo" in case wslview/xdg-open aren't available):
or like this:
or like this:
|
I don't think that's necessary, no-one has ever mentioned that case. How about:
to best balance simplicity, current logic, existing logic and avoid handling corner cases no-one has ever reported |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?In WSL,
xdg-open
is not available --wslview
is. So, addedwsl?
andwsl_version
methods toOS::Linux
to conditionally setPATH_OPEN
Additional "require" statements:
require "PATH"
in utils.rb: needed byPATH.new
inwhich
require "utils"
in linux.rb: needed bywhich
inos_version
require "version"
in os.rb: needed bysig { returns(Version) }
To test, execute
brew docs