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
list-buffersIn other ports List the paste buffers
- PowerShell No source-verified PowerShell equivalent is recorded for this operation.
- Julia No source-verified Julia equivalent is recorded for this operation.
- Ruby
- Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript
- Rust
- Go
- Java
- C#
- C++
- Swift
- Kotlin No source-verified Kotlin equivalent is recorded for this operation.
- Scala No source-verified Scala equivalent is recorded for this operation.
- F# No source-verified F# equivalent is recorded for this operation.