# window.Window.select

- **Module:** window.Window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/window.rs#L408
- **Page:** https://libtmux.org/reference/rs/window-window-select/

```
window.Window.select(mut) -> Result<&mut Self, Error>
```

Make this window active in the session it was reached through.

Targeted by id rather than by index. An index is a slot, not an
identity: anything that renumbers windows -- breaking a lone pane out
of one moves it to a free index -- leaves a handle's cached index
pointing at whatever occupies that slot now, which is a different live
window rather than nothing. tmux answers such a target without
complaint, so an index-scoped select would switch to the wrong window
and report success.

# Errors

Returns an error when tmux refuses the command, and
[`Error::ObjectGone`] when the window is no longer on the server.
