Skip to content

Commit

Permalink
wezterm tabs chevrons clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhomer committed Jan 24, 2024
1 parent f74fa72 commit 227ee74
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions dotfiles/wezterm/.wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ if wezterm.config_builder then
config = wezterm.config_builder()
end

local window_background = "#1f1f28"

-- This is where you actually apply your config choices

config.font = wezterm.font("FiraCode Nerd Font", { weight = "Medium" })
Expand All @@ -46,7 +48,7 @@ config.font_size = 12.5
config.force_reverse_video_cursor = true
config.colors = {
foreground = "#dcd7ba",
background = "#1f1f28",
background = window_background,
cursor_bg = "#c8c093",
cursor_fg = "#c8c093",
cursor_border = "#c8c093",
Expand All @@ -58,9 +60,10 @@ config.colors = {
brights = { "#727169", "#e82424", "#98bb6c", "#e6c384", "#7fb4ca", "#938aa9", "#7aa89f", "#dcd7ba" },
indexed = { [16] = "#ffa066", [17] = "#ff5d62" },
tab_bar = {
background = "#1F1F28",
background = window_background,
},
}
config.tab_max_width = 32

config.automatically_reload_config = true
config.window_decorations = "RESIZE"
Expand Down Expand Up @@ -131,27 +134,34 @@ local active_background = "#2D4F67"
local inactive_background = "#223249"

wezterm.on("format-tab-title", function(tab, tabs, panes, _config, hover, max_width)
local background = inactive_background
local right_edge_background = active_background
local left_edge_foreground = active_background
local foreground = "#727169"

if tab.is_active then
background = active_background
right_edge_background = inactive_background
left_edge_foreground = inactive_background
foreground = "##DCD7BA"
elseif hover then
background = "#3b3052"
foreground = "#909090"
local background = active_background
local right_edge_background = inactive_background
local left_edge_foreground = inactive_background
local foreground = "##DCD7BA"

if not tab.is_active then
background = inactive_background
foreground = "#727169"
right_edge_background = active_background
left_edge_foreground = active_background
if tab.tab_index < #tabs - 1 then
if not tabs[tab.tab_index + 2].is_active then
right_edge_background = inactive_background
end
end
end

if tab.tab_index == #tabs - 1 then
right_edge_background = window_background
end

local title = wezterm.truncate_right(tab_title(tab), max_width - 2)
local title = wezterm.truncate_left(" " .. tab_title(tab) .. " ", max_width + 2)
-- title = tostring(tab.tab_index)

return {
{ Background = { Color = background } },
{ Foreground = { Color = left_edge_foreground } },
{ Text = SOLID_RIGHT_ARROW },
{ Text = "" },
{ Background = { Color = background } },
{ Foreground = { Color = foreground } },
{ Text = title },
Expand Down

0 comments on commit 227ee74

Please sign in to comment.