My wezterm configuration. Allows workspace configurations with environment variables for each new workspace pane.
lazygit opens in a maximized pane
2 files changed, +16 -1
+14-0utils.lua
| @@ -0,0 +1,14 @@ | ||
| 1 | +local wezterm = require("wezterm") | |
| 2 | +local mux = wezterm.mux | |
| 3 | +local M = {} | |
| 4 | + | |
| 5 | +function M.SpawnMaximizedCommandInNewWindow(args) | |
| 6 | + return wezterm.action_callback(function(win, pane) | |
| 7 | + local cwd_uri = pane:get_current_working_dir() | |
| 8 | + local cwd = cwd_uri and cwd_uri.file_path or nil | |
| 9 | + _, _, win = mux.spawn_window({ args = args, cwd = cwd }) | |
| 10 | + win:gui_window():maximize() | |
| 11 | + end) | |
| 12 | +end | |
| 13 | + | |
| 14 | +return M |
+2-1wezterm.lua
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | local wezterm = require("wezterm") |
| 2 | +local utils = require("utils") | |
| 2 | 3 | local act = wezterm.action |
| 3 | 4 | local mux = wezterm.mux |
| 4 | 5 | local config = wezterm.config_builder() |
| @@ -76,7 +77,7 @@ config.keys = { | ||
| 76 | 77 | { |
| 77 | 78 | key = "g", |
| 78 | 79 | mods = "CTRL|SHIFT", |
| 79 | - action = act.SpawnCommandInNewWindow({ args = { "lazygit" } }), | |
| 80 | + action = utils.SpawnMaximizedCommandInNewWindow({ "lazygit" }), | |
| 80 | 81 | }, |
| 81 | 82 | } |
| 82 | 83 |