# TmuxMode

- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** enum
- **Source:** https://github.com/libtmux/libtmux-swift/blob/254f8b2be7eb60cacc3ffcb3ea8e456784f582df/Sources/LibTmux/TmuxMode.swift#L16
- **Page:** https://libtmux.org/en/swift/latest/reference/tmuxmode/

How work reaches tmux.

One dial with two settings. Choosing one never changes the call you write or
the type you get back — ``Server/sessions()`` returns `[Session]` either way.
What changes is whether that crossed a process boundary or a connection that
was already open.

| Mode | What it does | When it wins |
| --- | --- | --- |
| ``direct`` | A tmux process per call | One call, or calls far apart |
| ``connected(to:)`` | One live connection for the scope | More than one call, and anything that wants to be told what changed |

``Server/using(_:_:)`` takes one of these, so a program that decides at
runtime — a flag, a config file, a benchmark measuring both — writes the
choice as data instead of branching around two shapes of call.

## Members

- `!=(_:_:)` (function): Returns a Boolean value indicating whether two values are not equal.
- `direct` (constant): A tmux process per call. The default, and the one nothing has to say.
- `connected(to:)` (constant): One control-mode connection carrying every call in the scope.
