# window.Window

- **Module:** window
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/window.ts#L110
- **Page:** https://libtmux.org/en/ts/latest/reference/window-window/

One window on one tmux server, as a handle rather than a copy of it.

Reached from {@link Session.windows} or {@link Session.activeWindow}; the
constructor throws. The tmux format row the handle was built from reads back
through `format`, and by tmux's own field names directly on the handle —
a snapshot taken when the handle was made, not a live view.

A window can be linked into more than one session, so {@link Window.session}
is the session this handle was reached through rather than the only one
showing it.

## Members

- `windowBrand` (attribute)
- `server` (attribute): The server this handle addresses.
- `constructor` (method)
- `panes` (method): Panes of this window placement; a linked window keeps each set apart.
- `session` (method): The session this placement belongs to.
- `activePane` (method): The pane tmux marks active in this window.
- `linkedSessions` (method): Every session this window is linked into.
- `showHooks` (method): Read hooks set on this window itself.
- `setHook` (method): Bind a tmux command to a window-scoped hook.
- `unsetHook` (method): Remove every command bound to a window-scoped hook.
- `showOptions` (method): Every option set on this window itself, not the ones it inherits.
- `showResolvedOptions` (method): The option values that govern this window, own and inherited together.
- `setOption` (method): Set an option on this window.
- `unsetOption` (method): Remove an option from this window.
- `split` (method): Split this window and resolve the created pane.
- `plan` (method): The same mutations, described instead of run.
- `nextLayout` (method): Apply this window's next layout preset.
- `previousLayout` (method): Apply this window's previous layout preset.
- `rotate` (method): Rotate the panes within this window.
- `resize` (method): Resize this window, by a direction, to a size, or to what its clients allow.
- `respawn` (method): Restart the command running in this window's active pane.
- `unzoom` (method): Restore this window's layout, whichever of its panes was zoomed.
- `kill` (method): Destroy this window, unlinking it from every session it is in.
- `rename` (method): Rename this window.
- `move` (method): Move this window to another session or index without selecting it.
- `link` (method): Link this window into another session, giving it a second placement.
- `unlink` (method): Remove this placement, leaving the window's other placements intact.
- `removePlacement` (method): Remove this placement, destroying an unshared window but refusing a group.
- `swapWith` (method): Exchange positions with another window.
- `selectLayout` (method): Apply a named or custom layout.
- `select` (method): Make this window active in its session.
- `refreshed` (method): This window placement, read again at a new instant.
- `cmd` (method): Run a tmux command this package does not model, addressed at this window.
- `equals` (method): Whether `other` is this same window on this same server.
- `sameTmuxIdAs` (method): Whether `other` carries the same `@n`, wherever it came from.
- `toString` (method): How this handle renders in a log line, a template literal, or an error.
- `format` (property): The raw tmux format row, addressed by tmux's own token names.
