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

Output of external commands gets printed to stdout #20

Closed
SitiSchu opened this issue Mar 2, 2020 · 5 comments
Closed

Output of external commands gets printed to stdout #20

SitiSchu opened this issue Mar 2, 2020 · 5 comments
Assignees

Comments

@SitiSchu
Copy link

SitiSchu commented Mar 2, 2020

In my case on Linux the call to xdg-open causes Opening in existing browser session to be printed to the console. Would it make sense to silence all output of the external tools by default unless there's an error?

@amodm
Copy link
Owner

amodm commented Mar 2, 2020

Makes sense. Probably better with a flag (defaulted to false) that can be enabled to switch on the output.

@zwhitchcox
Copy link

Workaround:

Add to your Cargo.toml

[dependencies]
webbrowser = { git = "https://github.com/codota/webbrowser-rs", branch = "feature/add-suppress-output-flag-with-docs" }

In your code:

use webbrowser::{self, BrowserOptions};

    if webbrowser::open_browser_with_options(
      BrowserOptions {
        url: String::from(token_url),
        suppress_output: Some(true),
        browser: Some(webbrowser::Browser::Default),
      }).is_ok() {}

@zwhitchcox
Copy link

Ultimately should merge #22 though

@SDAChess
Copy link

SDAChess commented Jun 24, 2021

Hello! I am having the same issue here, bump ? :)

I can take care of it if no one is doing it

@amodm
Copy link
Owner

amodm commented Feb 19, 2022

Fixed in ecfbf66. By default, we now suppress output for all GUI browsers. This behaviour can be overridden. See Consistent Behaviour section for details.

@amodm amodm closed this as completed Feb 19, 2022
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 a pull request may close this issue.

4 participants