# cmd_save_buffer_exec

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L73
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-cmd-save-buffer-c-cmd_save_buffer_exec/

tmux command: [`save-buffer`](/en/tmux/3.2a/manual/save-buffer/)

tmux command: [`show-buffer`](/en/tmux/3.2a/manual/show-buffer/)

```c
static enum cmd_retval cmd_save_buffer_exec(struct cmd *, struct cmdq_item *)
```

## Parameters

- `self` (`struct cmd *`)
- `item` (`struct cmdq_item *`)

## Calls

- [`args_get`](/en/tmux/3.2a/reference/c-function-args_get/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L79)
- [`args_has`](/en/tmux/3.2a/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L108)
- [`cmd_get_args`](/en/tmux/3.2a/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L75)
- [`cmd_get_entry`](/en/tmux/3.2a/reference/c-function-cmd_get_entry/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L97)
- [`cmdq_error`](/en/tmux/3.2a/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L85)
- [`cmdq_get_client`](/en/tmux/3.2a/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L76)
- [`cmdq_print`](/en/tmux/3.2a/reference/c-function-cmdq_print/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L101)
- [`file_write`](/en/tmux/3.2a/reference/c-function-file_write/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L112)
- [`format_single_from_target`](/en/tmux/3.2a/reference/c-function-format_single_from_target/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L107)
- [`paste_buffer_data`](/en/tmux/3.2a/reference/c-function-paste_buffer_data/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L95)
- [`paste_get_name`](/en/tmux/3.2a/reference/c-function-paste_get_name/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L89)
- [`utf8_stravisx`](/en/tmux/3.2a/reference/c-function-utf8_stravisx/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L99)
- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-save-buffer.c#L105)

## Other function references

- [`cmd_save_buffer_done`](/en/tmux/3.2a/reference/c-function-cmd-save-buffer-c-cmd_save_buffer_done/) (function)
- [`paste_get_top`](/en/tmux/3.2a/reference/c-function-paste_get_top/) (function)

## Referenced by

- [`cmd_save_buffer_entry`](/en/tmux/3.2a/reference/c-variable-cmd_save_buffer_entry/) (attribute)
- [`cmd_show_buffer_entry`](/en/tmux/3.2a/reference/c-variable-cmd_show_buffer_entry/) (attribute)

## Referenced declarations

- [`args.argv`](/en/tmux/3.2a/reference/c-struct-args-argv/) (attribute)
- [`CLIENT_CONTROL`](/en/tmux/3.2a/reference/c-define-tmux-h-client_control/) (constant)
- [`cmd`](/en/tmux/3.2a/reference/c-struct-cmd/) (struct)
- [`CMD_RETURN_ERROR`](/en/tmux/3.2a/reference/c-enum-cmd_retval-cmd_return_error/) (constant)
- [`CMD_RETURN_NORMAL`](/en/tmux/3.2a/reference/c-enum-cmd_retval-cmd_return_normal/) (constant)
- [`CMD_RETURN_WAIT`](/en/tmux/3.2a/reference/c-enum-cmd_retval-cmd_return_wait/) (constant)
- [`cmd_retval`](/en/tmux/3.2a/reference/c-enum-cmd_retval/) (enum)
- [`cmd_show_buffer_entry`](/en/tmux/3.2a/reference/c-variable-cmd_show_buffer_entry/) (attribute)
- [`cmdq_item`](/en/tmux/3.2a/reference/c-struct-cmdq_item/) (struct)
- [`client.flags`](/en/tmux/3.2a/reference/c-struct-client-flags/) (attribute)
- [`client.session`](/en/tmux/3.2a/reference/c-struct-client-session/) (attribute)
