# LibTmux.kill_server

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/0e761d353bc0606f69ad87994958d09a92c7f7d1/src/operations.jl#L339
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-kill_server/

```
kill_server(server::LibTmux.Server; confirm, kwargs...)
```

## Methods

End the tmux daemon at `server`, with every session, window and pane in it, and return its `CommandResult`. Nothing is sent unless `confirm=true`: the call raises `ArgumentError` without it, because a borrowed endpoint is often the caller's own server and LibTmux never destroys one implicitly. An endpoint that names no socket is refused even when confirmed, because tmux would then choose the server `TMUX` names or the `default` socket; name the socket with `socket_path` or `socket_name`. The refusals send no command.

```julia
kill_server(server; confirm=false, timeout=5.0, cancel=nothing, strict=false)
```



An endpoint with no daemon has nothing to end, and the call returns an empty successful result. Only this call, never `close` or [`with_server`](/en/julia/latest/reference/libtmux-with_server/), sends `kill-server`. End a server you own with `close(owned)` instead, which also reaps the daemon and removes its directory. Failures after submission may have remote effects and are never retried.

# Examples

```julia
using LibTmux

with_server() do server
    borrowed = Server(; socket_path=server.socket_path)
    new_session(borrowed; name="work", command=["/bin/cat"])
    kill_server(borrowed; confirm=true)
end
```

## Parameters

- `server` (`LibTmux.Server`)
- `confirm` (`Bool`)
  Default: `false`.
- `kwargs`

## Guides

Pages that discuss `kill_server`.

- [Ownership and I/O](/en/julia/latest/topics/ownership/)
