# Search workspaces

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

> Search the fields of discovered workspace documents.

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/csharp/latest/workspace/reference/output/). An
empty successful search and a failed pattern are different outcomes.

[CLI source](https://github.com/libtmux/libtmux-dotnet/blob/f77fe776ba67a04abb20ddbbc26cf4a000d63b74/src/LibTmux.Workspace.Cli/README.md).
