mirror of
https://github.com/acedanger/dotfiles.git
synced 2025-12-05 22:30:13 -08:00
copied profile
This commit is contained in:
32
wezterm/.config/events/format-window-title.lua
Normal file
32
wezterm/.config/events/format-window-title.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
---@module "events.augment-window-title"
|
||||
---@author sravioli
|
||||
---@license GNU-GPLv3
|
||||
|
||||
local wt = require "wezterm"
|
||||
local fs = require("utils.fn").fs
|
||||
|
||||
wt.on("format-window-title", function(tab, pane, tabs, _, _)
|
||||
local zoomed = ""
|
||||
if tab.active_pane.is_zoomed then
|
||||
zoomed = "[Z] "
|
||||
end
|
||||
|
||||
local index = ""
|
||||
if #tabs > 1 then
|
||||
index = ("[%d/%d] "):format(tab.tab_index + 1, #tabs)
|
||||
end
|
||||
|
||||
---tab title
|
||||
local title = fs.basename(pane.title):gsub("%.exe%s?$", "")
|
||||
|
||||
local proc = pane.foreground_process_name
|
||||
if proc:find "nvim" then
|
||||
proc = proc:sub(proc:find "nvim")
|
||||
end
|
||||
if proc == "nvim" or title == "cmd" then
|
||||
local cwd, _ = fs.basename(pane.current_working_dir.file_path)
|
||||
title = ("Neovim (dir: %s)"):format(cwd)
|
||||
end
|
||||
|
||||
return zoomed .. index .. title
|
||||
end)
|
||||
Reference in New Issue
Block a user