# Search workspaces

Source: https://libtmux.org/en/ts/latest/workspace/cli/search/

> Search the fields of discovered workspace documents.

**Workspace Manager concept example** A working example of the core library. It can change without notice.



Search the fields of discovered workspace documents. Use literal matching when
the input should be treated as text rather than a regular expression.

## Find a session name

```console
$ tmux-workspace search \
    --json \
    --fixed-strings \
    --field session \
    workspace
```

Repeat `--field` to restrict additional fields. Query terms combine with AND;
`--any` selects OR. `--ignore-case`, `--smart-case`, `--word-regexp`, and
`--invert-match` control matching. Inspect the installed `search --help` for
supported field names and aliases.

Check both the exit status and [machine result](https://libtmux.org/en/ts/latest/workspace/reference/output/). An
empty successful search and a failed pattern are different outcomes.

[CLI source](https://github.com/libtmux/libtmux-ts/blob/f36d692552bb9a373b45338bb5fece854e57cc3d/packages/workspace-cli/README.md).
