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.

Go API

method libtmux-go latest

Pane.Swap

Swap exchanges the receiver with one exact or adjacent pane. Explicit targets use exact linked-pane views; PaneID alone does not distinguish linked views. Unless Detach is set, tmux may change active-pane selection; this is not a global client-focus guarantee. A directional swap cannot identify the adjacent target because tmux does not report it, so the returned PaneSwapResult.Target is zero.

Source and package
Qualified name
tmux.Pane.Swap
Package
tmux
Declared in
Pane
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/window_pane_swap.go
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptRustJavaC#C++ Swift Kotlin Scala OCaml F# Clojure

Description#

An explicit swap returns freshly materialized exact views for both original PaneIDs. If exact refresh fails after the command, Swap returns a predicted result carrying every known identity with the error. Earlier failures return zero; transport errors are delivery-ambiguous.

tmux command#

The tmux commands behind Swap.

tmux C API#

The C declarations in tmux that implement these commands.

In other ports#

Exchange two panes

Equivalents of Exchange two panes in other languages
Language Equivalent
Python libtmux.Pane.swap
Ruby LibTmux::Pane#swap
Lua libtmux.Pane:swap
Erlang tmux_pane:swap/3
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript pane.Pane.swapWith
Rust pane.Pane.swap_with
Java io.github.libtmux.Pane.swapWith
C# LibTmux.Pane.SwapAsync
C++ libtmux::Pane::swap_with
Swift Server.swap(_:with:) swaps windows, not panes
OCaml Libtmux_unix.Client.swap_panes
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.

No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference