From 0c3ce3d22efb1e1759f34cc7f108c69164bf128f Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sun, 13 Aug 2023 06:20:58 +0200 Subject: [PATCH] wezterm: tab bar: consider max width --- .config/wezterm/wezterm.lua.cgt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/wezterm/wezterm.lua.cgt b/.config/wezterm/wezterm.lua.cgt index cbae7bc..3eea842 100644 --- a/.config/wezterm/wezterm.lua.cgt +++ b/.config/wezterm/wezterm.lua.cgt @@ -59,7 +59,7 @@ (table.insert elems {:Background {:Color (bg tab)}}) (table.insert elems {:Foreground {:Color (fg tab)}}) - (table.insert elems {:Text (.. " " title " ")}) + (table.insert elems {:Text (.. " " (string.sub title 1 (math.min (- max_width 6) (length title))) " ")}) ;; last tab (when (= tab.tab_index (- (length tabs) 1)) @@ -88,4 +88,5 @@ {:Foreground {:Color :#45475a}} {:Background {:Color :#11111b}} {:Text ""}])} + :tab_max_width 128 : keys}