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
- func (p Pane) Swap( ctx context
.Context , request SwapPane , ) (PaneRequest Swap , error)Result -
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.
- Parameters
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
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| Erlang | tmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | pane |
| Rust | pane |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server.swap(_:with:) swaps windows, not panes |
| OCaml | Libtmux |
| 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#.