Window.swap
Swap this window with another via $ tmux swap-window.
Source and package
-
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_idxTrue>>> w2.window_index == w1_idxTrue
tmux command#
The tmux commands behind swap.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
Exchange two windows
| Language | Equivalent |
|---|---|
| Lua | libtmux |
| Erlang | tmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | window |
| Rust | window |
| Go | tmux |
| Java | no equivalent on Window |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |
No equivalent is recorded in Ruby, PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.