# cmdq_get_command

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L494
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-cmdq_get_command/

```c
struct cmdq_item * cmdq_get_command(struct cmd_list *cmdlist, struct cmdq_state *state)
```

## Parameters

- `cmdlist` (`struct cmd_list *`)
- `state` (`struct cmdq_state *`)

## Called by

- [`cmd_command_prompt_callback`](/en/tmux/3.7c/reference/c-function-cmd-command-prompt-c-cmd_command_prompt_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-command-prompt.c#L221)
- [`cmd_confirm_before_callback`](/en/tmux/3.7c/reference/c-function-cmd-confirm-before-c-cmd_confirm_before_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-confirm-before.c#L139)
- [`cmd_display_panes_key`](/en/tmux/3.7c/reference/c-function-cmd-display-panes-c-cmd_display_panes_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-display-panes.c#L287)
- [`cmd_if_shell_callback`](/en/tmux/3.7c/reference/c-function-cmd-if-shell-c-cmd_if_shell_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-if-shell.c#L165)
- [`cmd_if_shell_exec`](/en/tmux/3.7c/reference/c-function-cmd-if-shell-c-cmd_if_shell_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-if-shell.c#L99)
- [`cmd_run_shell_timer`](/en/tmux/3.7c/reference/c-function-cmd-run-shell-c-cmd_run_shell_timer/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-run-shell.c#L233)
- [`cmdq_insert_hook`](/en/tmux/3.7c/reference/c-function-cmdq_insert_hook/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L432)
- [`key_bindings_dispatch`](/en/tmux/3.7c/reference/c-function-key_bindings_dispatch/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L709)
- [`load_cfg`](/en/tmux/3.7c/reference/c-function-load_cfg/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L141)
- [`load_cfg_from_buffer`](/en/tmux/3.7c/reference/c-function-load_cfg_from_buffer/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cfg.c#L193)
- [`notify_insert_one_hook`](/en/tmux/3.7c/reference/c-function-notify-c-notify_insert_one_hook/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/notify.c#L52)
- [`server_client_default_command`](/en/tmux/3.7c/reference/c-function-server-client-c-server_client_default_command/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L2339)
- [`server_client_dispatch_command`](/en/tmux/3.7c/reference/c-function-server-client-c-server_client_dispatch_command/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L2412)

## Calls

- [`cmd_get_entry`](/en/tmux/3.7c/reference/c-function-cmd_get_entry/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L510)
- [`cmd_get_group`](/en/tmux/3.7c/reference/c-function-cmd_get_group/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L516)
- [`cmd_list_next`](/en/tmux/3.7c/reference/c-function-cmd_list_next/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L531)
- [`cmdq_free_state`](/en/tmux/3.7c/reference/c-function-cmdq_free_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L535)
- [`cmdq_link_state`](/en/tmux/3.7c/reference/c-function-cmdq_link_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L517)
- [`cmdq_new_state`](/en/tmux/3.7c/reference/c-function-cmdq_new_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L505)
- [`log_debug`](/en/tmux/3.7c/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L523)
- [`xasprintf`](/en/tmux/3.7c/reference/c-function-xasprintf/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L513)
- [`xcalloc`](/en/tmux/3.7c/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L512)

## Other function references

- [`cmd_list_first`](/en/tmux/3.7c/reference/c-function-cmd_list_first/) (function)
- [`cmdq_empty_command`](/en/tmux/3.7c/reference/c-function-cmd-queue-c-cmdq_empty_command/) (function)

## Referenced by

- [`cmd_parse_from_arguments`](/en/tmux/3.7c/reference/c-function-cmd_parse_from_arguments/) (function)
- [`key_bindings_init`](/en/tmux/3.7c/reference/c-function-key_bindings_init/) (function)

## Referenced declarations

- [`cmdq_item.cmd`](/en/tmux/3.7c/reference/c-struct-cmdq_item-cmd/) (attribute)
- [`cmd_list`](/en/tmux/3.7c/reference/c-struct-cmd_list/) (struct)
- [`cmdq_item.cmdlist`](/en/tmux/3.7c/reference/c-struct-cmdq_item-cmdlist/) (attribute)
- [`CMDQ_COMMAND`](/en/tmux/3.7c/reference/c-enum-cmdq_type-cmdq_command/) (constant)
- [`cmdq_get_callback`](/en/tmux/3.7c/reference/c-define-tmux-h-cmdq_get_callback/) (constant)
- [`cmdq_item`](/en/tmux/3.7c/reference/c-struct-cmdq_item/) (struct)
- [`cmdq_state`](/en/tmux/3.7c/reference/c-struct-cmdq_state/) (struct)
- [`cmdq_item.group`](/en/tmux/3.7c/reference/c-struct-cmdq_item-group/) (attribute)
- [`cmd_entry.name`](/en/tmux/3.7c/reference/c-struct-cmd_entry-name/) (attribute)
- [`cmdq_item.name`](/en/tmux/3.7c/reference/c-struct-cmdq_item-name/) (attribute)
- [`cmdq_item.next`](/en/tmux/3.7c/reference/c-struct-cmdq_item-next/) (attribute)
- [`cmd_list.references`](/en/tmux/3.7c/reference/c-struct-cmd_list-references/) (attribute)
- [`cmdq_item.state`](/en/tmux/3.7c/reference/c-struct-cmdq_item-state/) (attribute)
- [`cmdq_item.type`](/en/tmux/3.7c/reference/c-struct-cmdq_item-type/) (attribute)
