# types.ConnectedServer.subscribeFormat

- **Module:** types.ConnectedServer
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/types.ts#L958
- **Page:** https://libtmux.org/en/ts/latest/reference/types-connectedserver-subscribeformat/

```
types.ConnectedServer.subscribeFormat(subscription: : FormatSubscription) -> Promise<void>
```

Report a format whenever tmux expands it to a new value.

Reports arrive on {@link subscribe} as {@link TmuxSubscriptionEvent}.
Re-using a name replaces that subscription. The connection re-issues its
subscriptions after a reconnect, because they belong to the control client
that went away.

## Raises

- `TypeError`: when the name holds `:`, whitespace, or a control character, or the format holds a line break — each of which tmux would either misread or report unattributably.

## Example

```ts
await live.subscribeFormat({
  format: "#{pane_current_command}",
  name: "cmd",
  scope: "all-panes",
});
```
