File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ function Wezterm.new(opts)
3030 return self
3131end
3232
33+ local function focus_pane (pane_id )
34+ vim .fn .system (string.format (" wezterm cli activate-pane --pane-id %d" , pane_id ))
35+ end
36+
3337--- Check if `wezterm` is running in current terminal.
3438function Wezterm .health ()
3539 if vim .fn .executable (" wezterm" ) ~= 1 then
@@ -104,6 +108,8 @@ function Wezterm:start()
104108
105109 -- Execute and capture the pane ID
106110 local result = vim .fn .system (table.concat (cmd_parts , " " ))
111+ focus_pane (vim .env .WEZTERM_PANE )
112+
107113 self .pane_id = result :match (" ^%d+" )
108114 end
109115end
@@ -125,7 +131,7 @@ function Wezterm:show()
125131 return
126132 end
127133
128- vim . fn . system ( string.format ( " wezterm cli activate-pane --pane-id %d " , pane_id ) )
134+ focus_pane ( pane_id )
129135end
130136
131137return Wezterm
You can’t perform that action at this time.
0 commit comments