local wezterm = require("wezterm")
local mappings = require("modules.mappings")
local hyperlinks = require("modules.hyperlinks")

local config = {
	default_cursor_style = "BlinkingBlock",
	color_scheme = "Catppuccin Mocha",
	colors = {
		cursor_bg = "#A6ACCD",
		cursor_border = "#A6ACCD",
		cursor_fg = "#1B1E28",
	},
	-- font
	font = wezterm.font("JetBrains Mono", { weight = "Medium" }),
	font_size = 12,
	line_height = 1.0,
	window_background_opacity = 0.97,
	-- tab bar
	use_fancy_tab_bar = true,
	tab_bar_at_bottom = false,
	hide_tab_bar_if_only_one_tab = false,
	tab_max_width = 999999,
	window_padding = {
		left = 7,
		right = 7,
		top = 7,
		bottom = 7,
	},
	window_decorations = "RESIZE",
	window_close_confirmation = "NeverPrompt",
	inactive_pane_hsb = {
		brightness = 0.5,
	},
	send_composed_key_when_left_alt_is_pressed = false,
	send_composed_key_when_right_alt_is_pressed = true,
	-- key bindings
	leader = mappings.leader,
	keys = mappings.keys,
	key_tables = mappings.key_tables,
	hyperlink_rules = hyperlinks,
	audible_bell = "Disabled",
}

-- sessions.apply_to_config(config) -- optional, this adds default keybindings

-- Show which key table is active in the status area
wezterm.on("update-right-status", function(window, pane)
	local name = window:active_key_table()
	if name then
		name = "TABLE: " .. name
	end
	window:set_right_status(name or "")
end)

return config
