File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,22 @@ function WezTerm:new()
4141 return setmetatable (state , self )
4242end
4343
44+ --- Checks if wezterm is zoomed in
45+ --- @return boolean
46+ function WezTerm :zoomed ()
47+ local ok , panes = pcall (vim .json .decode , self .execute (' list --format json' ))
48+ if not ok then
49+ return false
50+ end
51+ local active_pane_id = tonumber (os.getenv (' WEZTERM_PANE' ))
52+ for _ , pane in ipairs (panes ) do
53+ if pane .pane_id == active_pane_id then
54+ return pane .is_zoomed
55+ end
56+ end
57+ return false
58+ end
59+
4460--- Switch pane in wezterm
4561--- @param direction Direction See | navigator.api.Direction |
4662--- @return WezTerm
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ local U = {}
55--- @return unknown
66function U .execute (cmd )
77 local handle = assert (io.popen (cmd ), string.format (' [Navigator] Unable to execute cmd - %q' , cmd ))
8- local result = handle :read ()
8+ local result = handle :read (" *a " )
99 handle :close ()
1010 return result
1111end
You can’t perform that action at this time.
0 commit comments