Server.list_panes
Behavior: Live acquisition.
Source and package
- Qualified name
-
LibTmux:: Server# list _panes - Module
- LibTmux
- Declared in
Server- Package
- libtmux
- Source
- gems/libtmux/lib/libtmux/server.rb
- Other languages
- Perlmethod Erlangfunction PowerShellcmdlet Juliafunction Elixirfunction Haskell Common Lispfunction PythonLuaTypeScriptRustGoJavaC#C++SwiftKotlinScalaOCamlF#function Clojurefunction
-
Description#
Behavior contract: Live acquisition.
Examples#
List panes across the server, within one session, and within one window. Use Ruby 3.3 or newer with Bundler, and tmux 3.3a or newer, on Unix with
/bin/catand/bin/shavailable. In an empty directory, save thisGemfile:source "https://rubygems.org"gem "libtmux", "0.1.2"Save this complete program as
list_panes.rb. ItsServer.startblock owns a private tmux server and stops it on exit, including after an error. View source# frozen_string_literal: truerequire "libtmux"beginLibTmux::Server.start do |server|work = server.new_session(name: "work", command: ["/bin/cat"], receipt: true)work.pane.split(direction: :horizontal, command: ["/bin/cat"])server.new_session(name: "other", command: ["/bin/cat"])puts "server panes: #{server.list_panes.length}"puts "work panes: #{work.entity.list_panes.length}"puts "window panes: #{work.window.list_panes.length}"endrescue StandardError => errorwarn "#{error.class}: #{error.message}"exit 1endInstall the gem and run the program. An operation or cleanup error makes it exit unsuccessfully:
Terminal window $ bundle install && \bundle exec ruby list_panes.rbExpected output:
server panes: 3work panes: 2window panes: 2
tmux command#
The tmux commands behind list_panes.
list-panes -a server scope, cmd_list_panes_server tmux C API#
The C declarations in tmux that implement these commands.
Guides#
Pages that discuss list_panes.
In other ports#
List the server's panes
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Lua | libtmux |
| PowerShell | Lib Use the -Server parameter set to acquire panes across the server. |
| Julia | Lib panes with a Snapshot reads every captured physical pane. Use paneoccurrences for session placements. |
| Erlang | tmux Returns unique captured physical panes without tmux I/O. |
| Elixir | Lib Returns a Selection of every captured physical pane without contacting tmux. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| Common Lisp | libtmux: panes on a snapshot returns captured physical panes once each. |
| TypeScript | server |
| Rust | server |
| Go | tmux |
| Java | io |
| Clojure | libtmux Acquires a new graph and returns its pane occurrences. |
| Kotlin | io |
| Scala | io |
| C# | Lib |
| F# | Lib Builds a deferred pane query on the shared .NET LibTmux.Server. Query.list acquires panes across that server. |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | Libtmux |
| Perl | Lib One entry per captured physical pane; raw listings preserve contextual rows separately. |