dotfiles/home/apps/wezterm/extra.lua

26 lines
686 B
Lua
Raw Normal View History

2023-03-04 10:00:08 +01:00
local wezterm = require("wezterm")
local utils = require("utils")
2023-03-04 10:00:08 +01:00
local nonpadded_apps = { "nvim", "btop", "btm" }
wezterm.on("smartpadding", function(window, pane)
local fgp = pane:get_foreground_process_info()
if fgp == nil then
return
elseif utils.tableContains(nonpadded_apps, fgp.name) then
2023-03-04 10:00:08 +01:00
window:set_config_overrides({
window_padding = { left = 0, right = 0, top = 0, bottom = 0 },
})
else
window:set_config_overrides({
window_padding = wezterm.GLOBAL.smart_padding,
})
end
end)
wezterm.on("update-status", function(window, pane)
if wezterm.GLOBAL.smart_padding ~= nil then
wezterm.emit("smartpadding", window, pane)
end
end)