From 9731e4c3e5bac601375fcc4ed696e2342c4a334b Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 15 Sep 2024 09:04:54 -0400 Subject: [PATCH] more wezterm format-tab-title adjustments for the weird things i've seen this "feature" appears to be full of holes, seemingly limited by what process info wezterm is able to provide to you (which is probably limited by other things, etc etc). ugh. --- wezterm/wezterm.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua index a02a6f8..f3ee042 100644 --- a/wezterm/wezterm.lua +++ b/wezterm/wezterm.lua @@ -128,6 +128,9 @@ local function get_process(tab) if string.find(process_name, "kubectl") then process_name = "kubectl" end + if string.find(process_name, "python3") then + process_name = "python3" + end return { Icon = process_icons[process_name] or string.format("[%s]", process_name), @@ -157,13 +160,14 @@ wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_wid local title if process then - local sub_title = cwd - if process_use_suggested_title[process.Process] then - sub_title = get_suggested_tab_title(tab) - end - local icon = process.Icon or string.format("[%s]", process.Process) - title = string.format(" %s (%s) ", icon, sub_title) + if process_use_suggested_title[process.Process] then + title = string.format(" %s %s ", icon, get_suggested_tab_title(tab)) + else + title = string.format(" %s (%s) ", icon, cwd) + end + else + title = string.format(" %s %s ", wezterm.nerdfonts.cod_terminal_bash, get_suggested_tab_title(tab)) end if has_unseen_output then