# tmux list-panes

Source: https://libtmux.org/en/tmux/latest/manual/list-panes/

> If -a is given, target is ignored and all panes on the server are listed.

If -a is given, target is ignored and all panes on the server are listed.

## Syntax

```tmux-usage
tmux list-panes [-asr] [-F format] [-f filter] [-O order][-t target-window]
```

Alias: `lsp`.

## Behavior

If `-a` is given, `target` is ignored and all panes on the server are listed. If `-s` is given, `target` is a session (or the current session). If neither is given, `target` is a window (or the current window). `-F` specifies the format of each line and `-f` a filter. Only panes for which the filter is true are shown. See the [FORMATS](https://libtmux.org/en/tmux/latest/manual/full/#FORMATS) section. `-O` specifies the sort order: one of ‘`name`’ (title), ‘`index`’, ‘`size`’ (area), ‘`creation`’ (time), or ‘`activity`’ (time). `-r` reverses the sort order.

## Guides

* [Find sessions, windows, and panes](https://libtmux.org/en/tmux/guides/querying-and-filtering/)

## C implementation

Internal declarations in tmux 3.7c:

* [`cmd_list_panes_entry`](https://libtmux.org/en/tmux/latest/reference/c-variable-cmd_list_panes_entry/)
* [`cmd_list_panes_exec`](https://libtmux.org/en/tmux/latest/reference/c-function-cmd-list-panes-c-cmd_list_panes_exec/)

## Use from a library

Each API describes its own defaults, errors and execution model.

* [Scala](https://libtmux.org/en/scala/latest/reference/io-github-libtmux-scaladsl-window-panes/)
* [Kotlin](https://libtmux.org/en/kotlin/latest/reference/io-github-libtmux-kotlin-window-panes/)
* [Python](https://libtmux.org/en/py/latest/reference/libtmux-window-panes/)
* [TypeScript](https://libtmux.org/en/ts/latest/reference/window-window-panes/)
* [Rust](https://libtmux.org/en/rs/latest/reference/window-window-panes/)
* [Go](https://libtmux.org/en/go/latest/reference/tmux-window-panes/)
* [Java](https://libtmux.org/en/java/latest/reference/io-github-libtmux-window-window-panes/)
* [C#](https://libtmux.org/en/csharp/latest/reference/libtmux-window-panes/)
* [C++](https://libtmux.org/en/cxx/latest/reference/libtmux-window-panes/)
* [Swift](https://libtmux.org/en/swift/latest/reference/snapshot-panes\(of-\)/)
* [Ruby](https://libtmux.org/en/ruby/latest/reference/libtmux-window-list_panes/)
* [F#](https://libtmux.org/en/fsharp/latest/reference/libtmux-fsharp-server-panes/)
* [Lua](https://libtmux.org/en/lua/latest/reference/libtmux-snapshot-panes/)

tmux sources and license

Syntax comes from `tmux 3.7c list-commands`. See the [global options](https://libtmux.org/en/tmux/latest/manual/full/#DESCRIPTION) for sockets and configuration, and [command syntax and targets](https://libtmux.org/en/tmux/latest/manual/full/#COMMANDS).

Behavior is taken from the [tmux 3.7c manual](https://github.com/tmux/tmux/blob/79072dd1a9f5fb437a5859e362a496fd57ec0981/tmux.1).

[Command declaration](https://github.com/tmux/tmux/blob/79072dd1a9f5fb437a5859e362a496fd57ec0981/cmd-list-panes.c#L38)

```
Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
