# LibTmux.Selection.new/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/selection.ex#L25
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-selection-new-2/

```
new(snapshot, entity)
@spec new(
        LibTmux.Snapshot.t(),
        :session | LibTmux.Session
      ) :: t(LibTmux.Session.t())

new(snapshot, entity)
@spec new(LibTmux.Snapshot.t(), :window | LibTmux.Window) ::
        t(LibTmux.Window.t())

new(snapshot, entity)
@spec new(LibTmux.Snapshot.t(), :pane | LibTmux.Pane) ::
        t(LibTmux.Pane.t())

new(snapshot, entity)
@spec new(
        LibTmux.Snapshot.t(),
        :window_link | LibTmux.WindowLink
      ) :: t(LibTmux.WindowLink.t())

new(snapshot, entity)
@spec new(LibTmux.Snapshot.t(), :client | LibTmux.Client) ::
        t(LibTmux.Client.t())
```

Materializes the observed items of an entity without I/O.

See the [worked example](api-examples.html#local-graph-and-filtering).

## Parameters

- `snapshot` (`LibTmux.Snapshot.t()`)
- `entity` (`:session | LibTmux.Session`) (for `new/2(snapshot, entity) [overload 1]`)
- `entity` (`:window | LibTmux.Window`) (for `new/2(snapshot, entity) [overload 2]`)
- `entity` (`:pane | LibTmux.Pane`) (for `new/2(snapshot, entity) [overload 3]`)
- `entity` (`:window_link | LibTmux.WindowLink`) (for `new/2(snapshot, entity) [overload 4]`)
- `entity` (`:client | LibTmux.Client`) (for `new/2(snapshot, entity) [overload 5]`)
