Server.list_buffers
List paste buffers via $ tmux list-buffers.
Source and package
-
Description#
Without arguments returns tmux's default template (
name: N bytes: "sample") — kept for backward compatibility. Pass format_string to request a specific tmux format, or filter to have tmux return only matching buffers.Examples#
Default template (backward-compatible):
>>> server.set_buffer('buf_data')>>> result = server.list_buffers()>>> len(result) >= 1TrueProject just the names:
>>> server.set_buffer('hello', buffer_name='gap6_demo')>>> 'gap6_demo' in server.list_buffers(format_string='#{buffer_name}')TrueFilter via tmux:
>>> matches = server.list_buffers(... format_string='#{buffer_name}',... filter='#{m:gap6_*,#{buffer_name}}',... )>>> 'gap6_demo' in matchesTrue- Parameters
-
-
format_string(str | None) # – Output template (-Fflag). Example:"#{buffer_name}"for raw names only. added 0.57 -
filter(str | None) # – Filter expression evaluated by tmux (-fflag). Buffers for which the expanded expression is false are omitted. Example:"#{m:libtmux_mcp_*,#{buffer_name}}". Note: this kwarg shadows the Python builtinfilterby design — it mirrors tmux's own flag name (-f filter) for grep-friendly symmetry between the wrapper and the tmux manual. tmux silently expands a malformed filter (unclosed#{...}, unknown format token) to empty, which the filter treats as false — every row is suppressed and no stderr is emitted. A bad filter is indistinguishable from "filter matched nothing"; verify filter syntax against the FORMATS section oftmux(1). Warning: added 0.57
-
- Returns
-
list[str] Raw output lines.
tmux command#
The tmux commands behind list_buffers.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
List the paste buffers
| Language | Equivalent |
|---|---|
| Ruby | Lib |
| Erlang | tmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | server |
| Rust | server |
| Go | tmux |
| Java | io |
| 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 Lua, PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.