From b74370187d88f6dafbb1f1895b5a0ef67fdacc1a Mon Sep 17 00:00:00 2001 From: Patrik Stier Date: Thu, 24 Aug 2023 18:51:07 +0200 Subject: [PATCH] Add WezTerm zoom support --- lua/Navigator/mux/wezterm.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/Navigator/mux/wezterm.lua b/lua/Navigator/mux/wezterm.lua index 8afdcef..dd92c1a 100644 --- a/lua/Navigator/mux/wezterm.lua +++ b/lua/Navigator/mux/wezterm.lua @@ -41,6 +41,12 @@ function WezTerm:new() return setmetatable(state, self) end +---Checks if wezterm is zoomed in +---@return boolean +function WezTerm:zoomed() + return self.execute([[list --format json | grep -Pzo "(?s)(?<=\"pane_id\": $WEZTERM_PANE).*?is_zoomed\":\ \K(.*?)(?=,)"]]) == 'true' +end + ---Switch pane in wezterm ---@param direction Direction See |navigator.api.Direction| ---@return WezTerm