From 2b3753d99c99506f48c6f0dbfc5a82e3f2133f9a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Jun 2020 22:56:54 +0530 Subject: [PATCH] Prevent super large tab margin widths from causing a crash Fixes #2793 --- kitty/tab_bar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/tab_bar.py b/kitty/tab_bar.py index 1680053a7..6d41798e9 100644 --- a/kitty/tab_bar.py +++ b/kitty/tab_bar.py @@ -261,7 +261,7 @@ class TabBar: return self.cell_width = cell_width s = self.screen - viewport_width = tab_bar.width - 2 * self.margin_width + viewport_width = max(4 * cell_width, tab_bar.width - 2 * self.margin_width) ncells = viewport_width // cell_width s.resize(1, ncells) s.reset_mode(DECAWM)