# pane.Pane.chooseTree

- **Module:** pane
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/pane.ts#L680
- **Page:** https://libtmux.org/en/ts/latest/reference/pane-pane-choosetree/

```
chooseTree(options?: ChooseTreeOptions): Promise<void>
```

Open the interactive session and window chooser in this pane.

The promise resolves once the chooser is on screen, not once someone
has chosen: tmux answers this command as soon as it opens the mode.
Bind a tmux command to the selection to act on what was picked.

tmux needs a client attached to the session to draw this. With none, it
does nothing and reports success, so a headless run is told it worked.

## Examples

```ts
await pane.chooseTree({ sessionsOnly: true });
```

## Parameters

- `options?` (`ChooseTreeOptions`)

## tmux command

The tmux commands behind `chooseTree`.

- [`choose-tree`](/en/tmux/latest/manual/choose-tree/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_choose_tree_entry`](/en/tmux/latest/reference/c-variable-cmd_choose_tree_entry/) (attribute)
- [`cmd_choose_tree_exec`](/en/tmux/latest/reference/c-function-cmd-choose-tree-c-cmd_choose_tree_exec/) (function)

## In other ports

Open the session and window chooser in a pane

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Pane.choose_tree`](/en/py/latest/reference/libtmux-pane-choose_tree/) (method) |
| Rust | no equivalent on `Pane` |
| Go | [`tmux.Pane.ChooseTree`](/en/go/latest/reference/tmux-pane-choosetree/) (method) |
| Java | no equivalent on `Pane` |
| C# | [`LibTmux.Pane.ChooseTreeAsync`](/en/csharp/latest/reference/libtmux-pane-choosetreeasync/) (method) |
| C++ | no equivalent on `Pane` |
| Swift | no equivalent on `Pane` |

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Elixir, Kotlin, Scala or F#.
