-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.lua
More file actions
30 lines (27 loc) · 809 Bytes
/
utils.lua
File metadata and controls
30 lines (27 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
local wezterm = require 'wezterm'
local module = {}
function module.workspace_single_pane(window, pane, workspace, command)
local _, pane, _ = wezterm.mux.spawn_window{
workspace = workspace
}
pane:activate()
pane:send_text(command)
return window:perform_action(wezterm.action.SwitchToWorkspace {
name = workspace
}, pane)
end
function module.workspace_double_pane(window, pane, direction, workspace, command1, command2)
local _, pane_bottom, _ = wezterm.mux.spawn_window{
workspace = workspace
}
local pane_top = pane_bottom:split {
direction = direction or "Top"
}
pane_top:activate()
pane_top:send_text(command1)
pane_bottom:send_text(command2)
return window:perform_action(wezterm.action.SwitchToWorkspace {
name = workspace
}, pane)
end
return module