LinuxCommandLibrary

wezterm-cli

Manage WezTerm multiplexer sessions

TLDR

List windows, tabs, and panes

$ wezterm cli list
copy

Split the current pane and print the new pane's ID to stdout
$ wezterm cli split-pane --[left|right|top|bottom] --[cells|percent] [n]
copy

Activate (focus) a pane
$ wezterm cli activate-pane --pane-id [id]
copy

Kill a pane
$ wezterm cli kill-pane --pane-id [id]
copy

SYNOPSIS

wezterm-cli [OPTIONS] SUBCOMMAND [ARGS]

PARAMETERS

-h, --help
    Displays help information for the main command or a specified subcommand.

-V, --version
    Prints the wezterm-cli version information.

--config
    Specifies an alternative configuration file to load for the WezTerm instance being interacted with.

--skip-config
    Prevents loading the user's default configuration file.


    Specifies the action to perform. Each subcommand has its own specific arguments and options (e.g., list, spawn, send-text, split-pane, reload-configuration).

DESCRIPTION

wezterm-cli is the command-line interface for the WezTerm GPU-accelerated terminal emulator. It provides a powerful way to interact with running WezTerm instances, enabling users to script, automate, and manage their terminal sessions programmatically.

With wezterm-cli, you can perform various actions such as listing active windows and panes, creating new tabs or split panes, sending text to specific panes, reloading configuration, activating windows, and much more. It's an essential tool for integrating WezTerm into shell scripts, CI/CD pipelines, or personal workflows that require programmatic control over the terminal environment. Its capabilities extend beyond simple interaction, allowing for complex session management and introspection of the terminal state.

CAVEATS

Requires a running WezTerm GUI instance for most commands to operate on.
Some commands may behave differently based on the active pane or window context.
The exact set of subcommands and their options can vary between WezTerm versions. Always consult wezterm-cli --help for the most accurate and up-to-date information for your installed version.

SUBCOMMANDS OVERVIEW

The wezterm-cli operates primarily through a rich set of subcommands, each designed for a specific task. Key subcommands include:
list: Displays active windows, tabs, and panes.
spawn: Creates new windows, tabs, or panes.
split-pane: Divides the current pane into multiple panes.
send-text: Injects text input into a specific pane.
activate: Brings a specific window or pane to the foreground.
reload-configuration: Forces all running WezTerm instances to reload their configuration.
This modular design allows for fine-grained control and powerful scripting.

HISTORY

wezterm-cli evolved alongside the WezTerm terminal emulator, which was first released in 2019 by Wez Furlong. As WezTerm aimed to be a highly customizable and scriptable terminal, the need for a programmatic interface became apparent. The wezterm-cli was developed to provide this capability, allowing users to automate common tasks, integrate WezTerm into their development workflows, and manage sessions in a way similar to traditional terminal multiplexers but with WezTerm's unique features. Its design reflects WezTerm's philosophy of powerful configuration and extensibility.

SEE ALSO

wezterm(1), tmux(1), screen(1), ssh(1)

Copied to clipboard