# types.ConnectedServer.subscribeFormat

- **Module:** types.ConnectedServer
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/types.ts#L898
- **Page:** https://libtmux.org/reference/ts/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",
});
```
