zkat / miette

Fancy extension for std::error::Error with pretty, detailed diagnostic printing.
https://docs.rs/miette
Apache License 2.0
1.98k stars 113 forks source link

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

Closed Boshen closed 8 months ago

Boshen commented 9 months ago

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).