Pane.new_pane
Create a floating Pane via $ tmux new-pane (tmux 3.7+).
Source and package
- Qualified name
-
libtmux.Pane .new _pane - Module
- libtmux
- Declared in
- Pane
- Package
- libtmux
- Source
- src/libtmux/pane.py
-
Description#
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 byWindow.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 thisremain-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 – If the tmux server is older than 3.7 (.Lib Tmux Exception new-paneis unavailable).
-