# LibTmux.Server.new/1

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/server.ex#L234
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-server-new-1/

```
new(options)
@spec new([option()]) :: t()
```

Constructs a descriptor for an existing server without connecting or creating it.

`:socket` selects the socket by path and `:socket_name` by name; pass at most
one. With neither, the descriptor reads `LIBTMUX_SOCKET_PATH`, then
`LIBTMUX_SOCKET`, from `:env`, and selects no socket when neither is set, so
tmux uses its default. See "Choosing the server" in the module
documentation. Raises `ArgumentError` for conflicting or invalid input,
naming a variable but never its value.

See the [worked example](first-task.html).

## Parameters

- `options` (`[option()]`)

## Guides

Pages that discuss `new/1`.

### Concepts

- [Captured tmux state](/en/elixir/pr-173/concepts/observations/)

### Examples

- [Capture a pane and read it](/en/elixir/pr-173/examples/capture-and-read/)

### Guides

- [Attaching to tmux](/en/elixir/pr-173/guides/attaching-to-tmux/)

### Topics

- [Execution ownership](/en/elixir/pr-173/topics/ownership/)
