libtmux Reference MCP Search
On this page

libtmux.Window.new_pane

View as Markdown

Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
new_pane
( 17 parameters ) ( self , target : int | str | None = None , start_directory : StrPath | None = None , attach : bool = False , shell : str | None = None , environment : dict[str, str] | None = None , width : int | None = None , height : int | None = None , x : int | None = None , y : int | None = None , zoom : bool | None = None , empty : bool | None = None , style : str | None = None , active_border_style : str | None = None , inactive_border_style : str | None = None , message : str | None = None , keep : bool | None = None )
Pane
method [source]
method [source]
new_pane

Create a floating Pane in this window ($ tmux new-pane).

Use split for a tiled pane. Floating panes require tmux 3.7+; delegates to Pane.new_pane on the active pane.

Examples

>>> from libtmux.common import has_gte_version
>>> if has_gte_version("3.7"):
...     floating = window.new_pane(width=40, height=10, shell="sleep 5")
...     is_floating = floating.pane_floating_flag
... else:
...     is_floating = "1"
>>> is_floating
'1'
Parameters
  • target ( int | str | None ) – Custom *target-pane*.

  • start_directory ( StrPath | None ) – Working directory for the new pane (-c).

  • attach ( bool ) – Make the new pane active, default False (-d otherwise).

  • shell ( str | None ) – Command to run; the pane closes when it exits.

  • environment ( dict[str, str] | None ) – Environment variables for the new pane (-e).

  • width ( int | None ) – Width in cells (-x).

  • height ( int | None ) – Height in cells (-y).

  • x ( int | None ) – X position in cells (-X).

  • y ( int | None ) – Y position in cells (-Y).

  • zoom ( bool | None ) – Zoom the pane (-Z).

  • empty ( bool | None ) – Create an empty pane with no command (-E).

  • style ( str | None ) – Style for the floating pane (-s).

  • active_border_style ( str | None ) – Border style when the pane is active (-S).

  • inactive_border_style ( str | None ) – Border style when the pane is inactive (-R).

  • message ( str | None ) – Keep the pane open (until a key is pressed) after the command exits, showing this remain-on-exit-format message (-m).

  • keep ( bool | None ) – Keep the pane open until a key is pressed after exit (-k), using the default remain-on-exit-format.

Returns

Pane The newly created floating pane.

0 declared, 0 inherited

Esc

Type to search.