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

Bail from try_xdg if browser name is empty #64

Merged
merged 1 commit into from
Jan 30, 2023
Merged

Bail from try_xdg if browser name is empty #64

merged 1 commit into from
Jan 30, 2023

Conversation

krsh732
Copy link
Contributor

@krsh732 krsh732 commented Jan 30, 2023

Hey, not sure if I'm horribly off the mark. Had an infinite loop in WSL with the following on main branch:

fn main() -> Result<(), std::io::Error> {
    println!("HI");
    webbrowser::open("https://youtube.com")?;
    println!("BYE");
    Ok(())
}

There was apparently no default for browser in xdg settings:
image

This causes an infinite loop because open_using_xdg_config ends up opening a directory and rust-lang/rust#64144?

Fixed it by simply bailing if there is no name.

@amodm
Copy link
Owner

amodm commented Jan 30, 2023

Thanks for your first contribution here, @krsh732. LGTM.

@amodm amodm merged commit 26253d6 into amodm:main Jan 30, 2023
@amodm
Copy link
Owner

amodm commented Jan 30, 2023

@krsh732, I'm unable to test this manually due to some issues with my Windows VM. I can release this only after confirmation that post this change, it did work for you, as in the non-xdg codepath kicked in, and opened the default windows browser.

Can you please confirm?

@krsh732
Copy link
Contributor Author

krsh732 commented Jan 30, 2023

@amodm, Yeah can confirm that the browser opens into the right change after this change:
Code_feXTHUADGZ

@amodm
Copy link
Owner

amodm commented Jan 30, 2023

Awesome, thanks. This is now out as v0.8.7

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.

None yet

2 participants