# server.Server.checkAlive

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

```
checkAlive(): Promise<void>
```

Assert the server is reachable, raising with tmux's reason if not.

Every read already raises on an unreachable server, so this is not what
tells an empty result from a missing one — it is the assertion form of
[`isAlive`](/en/ts/latest/reference/server-server-isalive/), for a caller that wants the check and the reason without a
read to hang it on.

## Examples

```ts
await server.checkAlive(); // throws when no tmux server is listening
```

## tmux command

The tmux commands behind `checkAlive`.

- [`list-sessions`](/en/tmux/latest/manual/list-sessions/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_list_sessions_entry`](/en/tmux/latest/reference/c-variable-cmd_list_sessions_entry/) (attribute)
- [`cmd_list_sessions_exec`](/en/tmux/latest/reference/c-function-cmd-list-sessions-c-cmd_list_sessions_exec/) (function)
