# types.ConnectedServer.subscribeFormat

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

```
subscribeFormat(
  subscription: FormatSubscription,
): Promise<void>
```

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

Reports arrive on [`subscribe`](/en/ts/latest/reference/types-connectedserver-subscribe/) as [`TmuxSubscriptionEvent`](/en/ts/latest/reference/types-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.

## Examples

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

## Parameters

- `subscription` (`FormatSubscription`)

## Raises

- [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/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.
