On this page
libtmux.Pane.new_pane
- Module
- libtmux
- Declared in
- Pane
- Package
- libtmux
- Source
- src/libtmux/pane.py
-
Create a floating
Panevia$ tmux new-pane(tmux 3.7+).Use
splitfor 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 haspane_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 (
-cflag). -
attach ( bool ) – Make the new pane the active pane, default False (
-dwhen 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 (
-eflag). -
width ( int | None ) – Width of the floating pane in cells (
-xflag). -
height ( int | None ) – Height of the floating pane in cells (
-yflag). -
x ( int | None ) – X position of the floating pane in cells (
-Xflag). -
y ( int | None ) – Y position of the floating pane in cells (
-Yflag). -
empty ( bool | None ) – Create an empty pane with no command (
-Eflag). -
style ( str | None ) – Style for the floating pane (
-sflag). -
active_border_style ( str | None ) – Border style when the pane is active (
-Sflag). -
inactive_border_style ( str | None ) – Border style when the pane is inactive (
-Rflag). -
message ( str | None ) – Keep the pane open (until a key is pressed) after the command exits, showing this
remain-on-exit-formatmessage (-mflag). -
keep ( bool | None ) – Keep the pane open until a key is pressed after the command exits (
-kflag), using the defaultremain-on-exit-format.
-
- Returns
-
PaneThe newly created floating pane. - Raises
-
-
libtmux.exc.LibTmuxException – If the tmux server is older than 3.7 (
new-paneis unavailable).
-
0 declared, 0 inherited