Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

Python documentation

libtmux.Window.swap

View as Markdown

Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
Other languages
Ruby LuaTypeScriptRustGo Java .NETC++Swift
swap ( self , target : str | Window , detach : bool | None = None ) → None
method [source]
method [source]
swap

Swap this window with another via $ tmux swap-window.

Parameters
  • target ( str | Window ) – Target window to swap with. Can be a window ID string or Window.

  • detach ( bool | None ) – Do not change the active window (-d flag).

In other ports Exchange two windows

Examples

>>> w1 = session.new_window(window_name='swap_a')
>>> w2 = session.new_window(window_name='swap_b')
>>> w1_idx = w1.window_index
>>> w2_idx = w2.window_index
>>> w1.swap(w2)
>>> w1.window_index == w2_idx
True
>>> w2.window_index == w1_idx
True
await window.swapWith(other);

0 declared, 0 inherited

Esc

Type to search.