From 47f25a289340bafdf670c961e48a6c3c3f18af26 Mon Sep 17 00:00:00 2001 From: graelo Date: Tue, 2 Jun 2020 23:23:47 +0200 Subject: [PATCH] fix: provide default termsize for headless test instances --- src/ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui.rs b/src/ui.rs index f2e6574..196cd3f 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -35,7 +35,7 @@ impl<'a> Ui<'a> { let lookup_trie = model::Model::build_lookup_trie(&matches); let focus_index = if model.reverse { matches.len() - 1 } else { 0 }; - let (term_width, _) = termion::terminal_size().expect("Cannot read the terminal size."); + let (term_width, _) = termion::terminal_size().unwrap_or((80u16, 30u16)); // .expect("Cannot read the terminal size."); let line_offsets = get_line_offsets(&model.lines, term_width); Ui {