libtmux Reference MCP Search
On this page

libtmux.Pane.new_pane

View as Markdown

Module
libtmux
Declared in
Pane
Package
libtmux
Source
src/libtmux/pane.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 via $ tmux new-pane (tmux 3.7+).

Use split for a tiled pane. Floating panes sit above the tiled layout like a popup, but unlike a popup they are not modal and behave like normal panes. The returned pane has pane_floating_flag == "1".

Examples

>>> from libtmux.common import has_gte_version
>>> if has_gte_version("3.7"):
...     floating = pane.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*, used by Window.new_pane .

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

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

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

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

  • width ( int | None ) – Width of the floating pane in cells (-x flag).

  • height ( int | None ) – Height of the floating pane in cells (-y flag).

  • x ( int | None ) – X position of the floating pane in cells (-X flag).

  • y ( int | None ) – Y position of the floating pane in cells (-Y flag).

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

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

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

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

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

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

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

Returns

Pane The newly created floating pane.

Raises

0 declared, 0 inherited

Esc

Type to search.