The Tab object is also known as
MuxTab in the WezTerm codebase. Available since version 20220624-141144-bd1b7c5d.MuxTab object represents a tab that is managed by the WezTerm multiplexer. It contains one or more panes arranged in a layout and provides methods to manage those panes and the tab’s state.
Tab objects cannot be created directly in Lua; they are typically accessed through window methods or event callbacks.
How to Access
Tab objects are commonly accessed through:- The
window:active_tab()method - The
pane:tab()method - Event callbacks
- The
wezterm.muxmodule
Identification
tab:tab_id()
Returns the unique tab identifier. Returns:number - The tab ID
Navigation Methods
tab:window()
Returns the MuxWindow object that contains this tab. Returns:MuxWindow | nil
tab:active_pane()
Returns the currently active pane in this tab. Returns:Pane | nil
tab:panes()
Returns an array of all panes in this tab (ignoring zoom state). Returns:Pane[]
tab:panes_with_info()
Returns an array of panes with extended layout information. Returns: Array of tables, each containing:number
The topological pane index
boolean
Whether this is the active pane in the tab
boolean
Whether this pane is zoomed
number
X offset from top-left of tab, in cells
number
Y offset from top-left of tab, in cells
number
Width of the pane in cells
number
Height of the pane in cells
number
Width of the pane in pixels
number
Height of the pane in pixels
Pane
The Pane object
tab:get_pane_direction(direction)
Returns the pane in a specific direction relative to the active pane.string
required
Direction to search: “Left”, “Right”, “Up”, or “Down”
Pane | nil
Title Methods
tab:get_title()
Returns the title of the tab. Returns:string
tab:set_title(title)
Sets the title of the tab.string
required
The new title for the tab
Size and Layout
tab:get_size()
Returns the size of the tab in cells. Returns: Table with fields:rows- number of rowscols- number of columnspixel_width- width in pixelspixel_height- height in pixelsdpi- DPI setting
tab:set_zoomed(zoomed)
Sets the zoom state of the active pane.boolean
required
Whether to zoom the active pane
boolean - The previous zoom state