Core LibrarystableAPI Reference

Choose documentation 3

stable

Current version

stable
English

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

Python API

method libtmux stable

Window.swap

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

Source and package
Qualified name
libtmux.Window.swap
Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
Other languages
PowerShell Julia Ruby LuaTypeScriptRustGo Java C#C++Swift Kotlin Scala F#
swap ( self, target: str | Window, detach: bool | None = None ) → None

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
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).

tmux command swap-window

In other ports Exchange two windows
Esc

Type to search.

Reference preview Open reference