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

Delete Irrelevant open command for unix #41

Merged
merged 1 commit into from
Feb 14, 2022
Merged

Conversation

tokusumi
Copy link
Contributor

open command works to handle browser for only MacOS.
For Unix, it cause the followings error:

$ cargo test
...
running 1 test
Couldn't get a file descriptor referring to the console
test tests::test_open_default ... FAILED

failures:

---- tests::test_open_default stdout ----
thread 'tests::test_open_default' panicked at 'failed to open browser: Custom { kind: Other, error: "return code 1" }', tests/common.rs:61:36

I found this error in WSL2 environments (no xdg-open, gvfs-open, gnome-open but x-www-browser is only available).
As a discussed here, open command in Unix is link to openvt command, which is not to open browser.
This cause panic and the process finish before calling x-www-browser.

This PR fix above problem and works fine by calling x-www-browser.

@amodm amodm self-requested a review February 14, 2022 14:30
@amodm amodm merged commit 1ac45cb into amodm:master Feb 14, 2022
@amodm
Copy link
Owner

amodm commented Feb 14, 2022

Thanks for fixing this, @tokusumi. LGTM. This will go out in the upcoming release (planned sometime this week).

@amodm
Copy link
Owner

amodm commented Feb 19, 2022

Documenting for future reference. The open command was originally added to support Haiku OS, so removal would break things on it. I've made appropriate changes in 696dd54 to make sure that open gets called only for Haiku, and not on other Unixes.

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

Successfully merging this pull request may close these issues.

2 participants