Skip to content

Commit f1dc89c

Browse files
authoredFeb 4, 2024
fix(handler): remove the two extra is_terminal sys call from MietteHandlerOpts::build (#325)
`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)`.
1 parent cb2ae2e commit f1dc89c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/handler.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,9 @@ impl MietteHandlerOpts {
247247
ThemeStyles::none()
248248
};
249249
let theme = self.theme.unwrap_or(GraphicalTheme { characters, styles });
250-
let mut handler = GraphicalReportHandler::new()
250+
let mut handler = GraphicalReportHandler::new_themed(theme)
251251
.with_width(width)
252-
.with_links(linkify)
253-
.with_theme(theme);
252+
.with_links(linkify);
254253
if let Some(with_cause_chain) = self.with_cause_chain {
255254
if with_cause_chain {
256255
handler = handler.with_cause_chain();

0 commit comments

Comments
 (0)
Please sign in to comment.