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

fix(handler): remove the two extra is_terminal sys call from MietteHandlerOpts::build #325

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

Boshen
Copy link
Contributor

@Boshen Boshen commented Dec 23, 2023

GraphicalReportHandler::new() calls GraphicalTheme::default()

theme: GraphicalTheme::default(),

which calls std::io::stdout().is_terminal() and std::io::stderr().is_terminal()

_ if !std::io::stdout().is_terminal() || !std::io::stderr().is_terminal() => {

but this default theme is overridden by with_theme(theme).

…eHandlerOpts::build`

`GraphicalReportHandler::new()` calls `GraphicalTheme::default()`

https://github.com/zkat/miette/blob/7ff4f874d693a665af4df40f4e94505013e3e262/src/handlers/graphical.rs#L52

which calls `std::io::stdout().is_terminal()` and `std::io::stderr().is_terminal()`

https://github.com/zkat/miette/blob/7ff4f874d693a665af4df40f4e94505013e3e262/src/handlers/theme.rs#L72

but this default theme is overridden by `with_theme(theme)`.
@zkat zkat merged commit f1dc89c into zkat:main Feb 4, 2024
@Boshen Boshen deleted the reduce-is-terminal-sys-call branch February 4, 2024 05:03
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