# format_choose

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4311
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-format-c-format_choose/

```c
static int format_choose(struct format_expand_state *es, const char *s, char **left, char **right, int expand)
```

## Parameters

- `es` (`struct format_expand_state *`)
- `s` (`const char *`)
- `left` (`char **`)
- `right` (`char **`)
- `expand` (`int`)

## Called by

- [`format_loop_panes`](/en/tmux/3.7c/reference/c-function-format-c-format_loop_panes/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4831)
- [`format_loop_sessions`](/en/tmux/3.7c/reference/c-function-format-c-format_loop_sessions/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4644)
- [`format_loop_windows`](/en/tmux/3.7c/reference/c-function-format-c-format_loop_windows/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4760)
- [`format_replace`](/en/tmux/3.7c/reference/c-function-format-c-format_replace/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L5349)
- [`format_replace_expression`](/en/tmux/3.7c/reference/c-function-format-c-format_replace_expression/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4978)

## Calls

- [`format_expand1`](/en/tmux/3.7c/reference/c-function-format-c-format_expand1/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4324)
- [`format_skip1`](/en/tmux/3.7c/reference/c-function-format-c-format_skip1/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4317)
- [`xstrdup`](/en/tmux/3.7c/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4321)
- [`xstrndup`](/en/tmux/3.7c/reference/c-function-xstrndup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4320)

## Referenced declarations

- [`format_expand_state`](/en/tmux/3.7c/reference/c-struct-format_expand_state/) (struct)
