# cmd_find_target

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

```c
int cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, const char *target, enum cmd_find_type type, int flags)
```

## Parameters

- `fs` (`struct cmd_find_state *`)
- `item` (`struct cmdq_item *`)
- `target` (`const char *`)
- `type` (`enum cmd_find_type`)
- `flags` (`int`)

## Called by

- [`cmd_attach_session`](/en/tmux/3.7c/reference/c-function-cmd_attach_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-attach-session.c#L87)
- [`cmd_move_window_exec`](/en/tmux/3.7c/reference/c-function-cmd-move-window-c-cmd_move_window_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-move-window.c#L73)
- [`cmd_switch_client_exec`](/en/tmux/3.7c/reference/c-function-cmd-switch-client-c-cmd_switch_client_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-switch-client.c#L76)
- [`cmdq_find_flag`](/en/tmux/3.7c/reference/c-function-cmd-queue-c-cmdq_find_flag/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L552)

## Calls

- [`cmd_find_clear_state`](/en/tmux/3.7c/reference/c-function-cmd_find_clear_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L969)
- [`cmd_find_copy_state`](/en/tmux/3.7c/reference/c-function-cmd_find_copy_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1045)
- [`cmd_find_get_pane`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_get_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1212)
- [`cmd_find_get_pane_with_session`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_get_pane_with_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1171)
- [`cmd_find_get_pane_with_window`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_get_pane_with_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1183)
- [`cmd_find_get_session`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_get_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1146)
- [`cmd_find_get_window`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_get_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1191)
- [`cmd_find_get_window_with_session`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_get_window_with_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1161)
- [`cmd_find_log_state`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_log_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1235)
- [`cmd_find_map_table`](/en/tmux/3.7c/reference/c-function-cmd-find-c-cmd_find_map_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1119)
- [`cmd_find_valid_state`](/en/tmux/3.7c/reference/c-function-cmd_find_valid_state/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L987)
- [`cmd_mouse_pane`](/en/tmux/3.7c/reference/c-function-cmd_mouse_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1013)
- [`cmd_mouse_window`](/en/tmux/3.7c/reference/c-function-cmd_mouse_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1021)
- [`cmdq_error`](/en/tmux/3.7c/reference/c-function-cmdq_error/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L984)
- [`cmdq_get_client`](/en/tmux/3.7c/reference/c-function-cmdq_get_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L997)
- [`cmdq_get_current`](/en/tmux/3.7c/reference/c-function-cmdq_get_current/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L976)
- [`fatalx`](/en/tmux/3.7c/reference/c-function-fatalx/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L988)
- [`log_debug`](/en/tmux/3.7c/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L965)
- [`server_check_marked`](/en/tmux/3.7c/reference/c-function-server_check_marked/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1040)
- [`xstrdup`](/en/tmux/3.7c/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-find.c#L1050)

## Other function references

- [`cmd_find_from_client`](/en/tmux/3.7c/reference/c-function-cmd_find_from_client/) (function)
- [`cmdq_get_event`](/en/tmux/3.7c/reference/c-function-cmdq_get_event/) (function)

## Referenced declarations

- [`window.active`](/en/tmux/3.7c/reference/c-struct-window-active/) (attribute)
- [`CMD_FIND_CANFAIL`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_canfail/) (constant)
- [`CMD_FIND_DEFAULT_MARKED`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_default_marked/) (constant)
- [`CMD_FIND_EXACT_SESSION`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_exact_session/) (constant)
- [`CMD_FIND_EXACT_WINDOW`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_exact_window/) (constant)
- [`CMD_FIND_PANE`](/en/tmux/3.7c/reference/c-enum-cmd_find_type-cmd_find_pane/) (constant)
- [`cmd_find_pane_table`](/en/tmux/3.7c/reference/c-variable-cmd-find-c-cmd_find_pane_table/) (attribute)
- [`CMD_FIND_PREFER_UNATTACHED`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_prefer_unattached/) (constant)
- [`CMD_FIND_QUIET`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_quiet/) (constant)
- [`CMD_FIND_SESSION`](/en/tmux/3.7c/reference/c-enum-cmd_find_type-cmd_find_session/) (constant)
- [`cmd_find_session_table`](/en/tmux/3.7c/reference/c-variable-cmd-find-c-cmd_find_session_table/) (attribute)
- [`cmd_find_state`](/en/tmux/3.7c/reference/c-struct-cmd_find_state/) (struct)
- [`cmd_find_type`](/en/tmux/3.7c/reference/c-enum-cmd_find_type/) (enum)
- [`CMD_FIND_WINDOW`](/en/tmux/3.7c/reference/c-enum-cmd_find_type-cmd_find_window/) (constant)
- [`CMD_FIND_WINDOW_INDEX`](/en/tmux/3.7c/reference/c-define-tmux-h-cmd_find_window_index/) (constant)
- [`cmd_find_window_table`](/en/tmux/3.7c/reference/c-variable-cmd-find-c-cmd_find_window_table/) (attribute)
- [`cmdq_item`](/en/tmux/3.7c/reference/c-struct-cmdq_item/) (struct)
- [`cmd_find_state.current`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-current/) (attribute)
- [`session.curw`](/en/tmux/3.7c/reference/c-struct-session-curw/) (attribute)
- [`cmd_find_state.flags`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-flags/) (attribute)
- [`cmd_find_state.idx`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-idx/) (attribute)
- [`key_event.m`](/en/tmux/3.7c/reference/c-struct-key_event-m/) (attribute)
- [`marked_pane`](/en/tmux/3.7c/reference/c-variable-marked_pane/) (attribute)
- [`cmd_find_state.s`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-s/) (attribute)
- [`client.session`](/en/tmux/3.7c/reference/c-struct-client-session/) (attribute)
- [`cmd_find_state.w`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-w/) (attribute)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
- [`cmd_find_state.wl`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-wl/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/3.7c/reference/c-struct-cmd_find_state-wp/) (attribute)
