# format_add

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

```c
void format_add(struct format_tree *ft, const char *key, const char *fmt,...)
```

## Parameters

- `ft` (`struct format_tree *`)
- `key` (`const char *`)
- `fmt` (`const char *`)
- `` (`...`)

## Called by

- [`cmd_display_menu_get_pos`](/en/tmux/3.7c/reference/c-function-cmd-display-menu-c-cmd_display_menu_get_pos/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-display-menu.c#L125)
- [`cmd_list_clients_exec`](/en/tmux/3.7c/reference/c-function-cmd-list-clients-c-cmd_list_clients_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-clients.c#L89)
- [`cmd_list_keys_exec`](/en/tmux/3.7c/reference/c-function-cmd-list-keys-c-cmd_list_keys_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-keys.c#L231)
- [`cmd_list_keys_format_add_key_binding`](/en/tmux/3.7c/reference/c-function-cmd-list-keys-c-cmd_list_keys_format_add_key_binding/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-keys.c#L146)
- [`cmd_list_panes_window`](/en/tmux/3.7c/reference/c-function-cmd-list-panes-c-cmd_list_panes_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-panes.c#L149)
- [`cmd_list_sessions_exec`](/en/tmux/3.7c/reference/c-function-cmd-list-sessions-c-cmd_list_sessions_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-sessions.c#L78)
- [`cmd_list_single_command`](/en/tmux/3.7c/reference/c-function-cmd-list-commands-c-cmd_list_single_command/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-commands.c#L55)
- [`cmd_list_windows_exec`](/en/tmux/3.7c/reference/c-function-cmd-list-windows-c-cmd_list_windows_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-list-windows.c#L96)
- [`cmd_run_shell_exec`](/en/tmux/3.7c/reference/c-function-cmd-run-shell-c-cmd_run_shell_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-run-shell.c#L141)
- [`cmd_show_messages_exec`](/en/tmux/3.7c/reference/c-function-cmd-show-messages-c-cmd_show_messages_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-show-messages.c#L96)
- [`cmdq_add_format`](/en/tmux/3.7c/reference/c-function-cmdq_add_format/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L271)
- [`cmdq_merge_formats`](/en/tmux/3.7c/reference/c-function-cmdq_merge_formats/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L293)
- [`format_add_window_neighbor`](/en/tmux/3.7c/reference/c-function-format-c-format_add_window_neighbor/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4718)
- [`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#L4784)
- [`format_merge`](/en/tmux/3.7c/reference/c-function-format_merge/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L3795)
- [`notify_add`](/en/tmux/3.7c/reference/c-function-notify-c-notify_add/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/notify.c#L200)
- [`notify_hook`](/en/tmux/3.7c/reference/c-function-notify_hook/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/notify.c#L250)
- [`status_message_redraw`](/en/tmux/3.7c/reference/c-function-status_message_redraw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/status.c#L642)
- [`status_prompt_redraw`](/en/tmux/3.7c/reference/c-function-status_prompt_redraw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/status.c#L901)
- [`window_buffer_get_key`](/en/tmux/3.7c/reference/c-function-window-buffer-c-window_buffer_get_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-buffer.c#L315)
- [`window_client_get_key`](/en/tmux/3.7c/reference/c-function-window-client-c-window_client_get_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L226)
- [`window_copy_formats`](/en/tmux/3.7c/reference/c-function-window-copy-c-window_copy_formats/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-copy.c#L977)
- [`window_customize_build`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_build/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L549)
- [`window_customize_build_array`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_build_array/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L248)
- [`window_customize_build_keys`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_build_keys/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L463)
- [`window_customize_build_option`](/en/tmux/3.7c/reference/c-function-window-customize-c-window_customize_build_option/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L296)
- [`window_tree_get_key`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_get_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L810)

## Calls

- [`xmalloc`](/en/tmux/3.7c/reference/c-function-xmalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L3925)
- [`xstrdup`](/en/tmux/3.7c/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L3926)
- [`xvasprintf`](/en/tmux/3.7c/reference/c-function-xvasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L3940)

## Referenced declarations

- [`format_entry.cb`](/en/tmux/3.7c/reference/c-struct-format_entry-cb/) (attribute)
- [`format_tree`](/en/tmux/3.7c/reference/c-struct-format_tree/) (struct)
- [`format_entry.key`](/en/tmux/3.7c/reference/c-struct-format_entry-key/) (attribute)
- [`format_entry.time`](/en/tmux/3.7c/reference/c-struct-format_entry-time/) (attribute)
- [`format_tree.tree`](/en/tmux/3.7c/reference/c-struct-format_tree-tree/) (attribute)
- [`format_entry.value`](/en/tmux/3.7c/reference/c-struct-format_entry-value/) (attribute)
