# LibTmux.Server.kill/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/00d34b3d387da72a5a416f1dd3962a98c76cedd2/lib/libtmux/server.ex#L421
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-server-kill-2/

```
kill(server, options \\ [])
@spec kill(t(), [LibTmux.Action.option()]) ::
        {:ok, LibTmux.Action.result(:ok)}
        | {:error, LibTmux.Action.error()}
```

Kills the server with [`kill-server`](/en/tmux/latest/manual/kill-server/), whoever started it.

Returns `{:ok, result}` when tmux acknowledges the command and
`{:error, error}` otherwise, for example when no server answers. The
command ends every session and pane on the server. It does not remove the
directory of a server from `start/1`; use `stop/2` for that. The only
option is `timeout` (5000 ms by default). See `LibTmux.Action` for outcomes.

    alias LibTmux.Server

    Server.kill(server)

## Parameters

- `server` (`t()`)
- `options` (`[LibTmux.Action.option()]`)
  Default: `[]`.

## Guides

Pages that discuss `kill/2`.

- [Getting started](/en/elixir/latest/guides/overview/)
