# cmd_set_option_exec

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L72
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-cmd-set-option-c-cmd_set_option_exec/

tmux command: [`set-hook`](/en/tmux/3.2a/manual/set-hook/)

tmux command: [`set-option`](/en/tmux/3.2a/manual/set-option/)

tmux command: [`set-window-option`](/en/tmux/3.2a/manual/set-window-option/)

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

## Parameters

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

## Calls

- [`args_has`](/en/tmux/3.2a/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L75)
- [`cmd_get_args`](/en/tmux/3.2a/reference/c-function-cmd_get_args/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L74)
- [`cmd_get_entry`](/en/tmux/3.2a/reference/c-function-cmd_get_entry/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L90)
- [`cmdq_error`](/en/tmux/3.2a/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L102)
- [`cmdq_get_target`](/en/tmux/3.2a/reference/c-function-cmdq_get_target/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L76)
- [`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-set-option.c#L87)
- [`notify_hook`](/en/tmux/3.2a/reference/c-function-notify_hook/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L91)
- [`options_array_assign`](/en/tmux/3.2a/reference/c-function-options_array_assign/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L197)
- [`options_array_clear`](/en/tmux/3.2a/reference/c-function-options_array_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L196)
- [`options_empty`](/en/tmux/3.2a/reference/c-function-options_empty/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L193)
- [`options_from_string`](/en/tmux/3.2a/reference/c-function-options_from_string/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L179)
- [`options_get`](/en/tmux/3.2a/reference/c-function-options_get/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L125)
- [`options_get_only`](/en/tmux/3.2a/reference/c-function-options_get_only/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L124)
- [`options_match`](/en/tmux/3.2a/reference/c-function-options_match/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L97)
- [`options_push_changes`](/en/tmux/3.2a/reference/c-function-options_push_changes/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L210)
- [`options_remove_or_default`](/en/tmux/3.2a/reference/c-function-options_remove_or_default/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L157)
- [`options_scope_from_name`](/en/tmux/3.2a/reference/c-function-options_scope_from_name/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L115)
- [`options_set_string`](/en/tmux/3.2a/reference/c-function-options_set_string/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L177)
- [`xstrdup`](/en/tmux/3.2a/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-option.c#L112)

## Other function references

- [`options_array_get`](/en/tmux/3.2a/reference/c-function-options_array_get/) (function)
- [`options_array_set`](/en/tmux/3.2a/reference/c-function-options_array_set/) (function)
- [`options_is_array`](/en/tmux/3.2a/reference/c-function-options_is_array/) (function)

## Referenced by

- [`cmd_set_hook_entry`](/en/tmux/3.2a/reference/c-variable-cmd_set_hook_entry/) (attribute)
- [`cmd_set_option_entry`](/en/tmux/3.2a/reference/c-variable-cmd_set_option_entry/) (attribute)
- [`cmd_set_window_option_entry`](/en/tmux/3.2a/reference/c-variable-cmd_set_window_option_entry/) (attribute)

## Referenced declarations

- [`args.argc`](/en/tmux/3.2a/reference/c-struct-args-argc/) (attribute)
- [`args.argv`](/en/tmux/3.2a/reference/c-struct-args-argv/) (attribute)
- [`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_retval`](/en/tmux/3.2a/reference/c-enum-cmd_retval/) (enum)
- [`cmd_set_hook_entry`](/en/tmux/3.2a/reference/c-variable-cmd_set_hook_entry/) (attribute)
- [`cmd_set_window_option_entry`](/en/tmux/3.2a/reference/c-variable-cmd_set_window_option_entry/) (attribute)
- [`cmdq_item`](/en/tmux/3.2a/reference/c-struct-cmdq_item/) (struct)
- [`options_entry.entry`](/en/tmux/3.2a/reference/c-struct-options_entry-entry/) (attribute)
- [`options_entry.name`](/en/tmux/3.2a/reference/c-struct-options_entry-name/) (attribute)
- [`window_pane.options`](/en/tmux/3.2a/reference/c-struct-window_pane-options/) (attribute)
- [`OPTIONS_TABLE_NONE`](/en/tmux/3.2a/reference/c-define-tmux-h-options_table_none/) (constant)
- [`OPTIONS_TABLE_WINDOW`](/en/tmux/3.2a/reference/c-define-tmux-h-options_table_window/) (constant)
- [`window.panes`](/en/tmux/3.2a/reference/c-struct-window-panes/) (attribute)
- [`options_entry.value`](/en/tmux/3.2a/reference/c-struct-options_entry-value/) (attribute)
- [`cmd_find_state.w`](/en/tmux/3.2a/reference/c-struct-cmd_find_state-w/) (attribute)
