Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux latest

Window.new_pane

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

Source and package
Qualified name
libtmux.Window.new_pane
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

Description#

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
Returns

Pane The newly created floating pane.

tmux command#

The tmux commands behind new_pane.

tmux C API#

The C declarations in tmux that implement these commands.

Each path starts at a function a command runs, which is degree 1. The degree counts steps from there along the path, and each step is a call or a reference: degree 2 is reached from that function, degree 3 from the next, and so on.

Split a window

  1. 1 cmd_split_window_exec
  2. references → 2 spawn_pane
  3. calls → 3 window_add_pane
  4. calls → 4 window_pane_create
Esc

Type to search.

Reference previewOpen reference