# window.Window

- **Module:** window
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-ts/blob/46cccfef2a546de55ce8b308249b8c76339089a0/packages/libtmux/src/window.ts#L122
- **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 [`Session.windows`](/en/ts/latest/reference/session-session-windows/) or [`Session.activeWindow`](/en/ts/latest/reference/session-session-activewindow/); the
constructor throws. The tmux format row the handle was built from reads back
through [`format`](/en/ts/latest/reference/window-window-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 [`Window.session`](/en/ts/latest/reference/window-window-session/)
is the session this handle was reached through rather than the only one
showing it.

## Members

### Parent objects

- [`session`](/en/ts/latest/reference/window-window-session/) (method): The session this placement belongs to.
- [`server`](/en/ts/latest/reference/window-window-server/) (attribute): The server this handle addresses.

### Collections and queries

- [`panes`](/en/ts/latest/reference/window-window-panes/) (method): Panes of this window placement; a linked window keeps each set apart.

### Common operations

- [`split`](/en/ts/latest/reference/window-window-split/) (method): Split this window and resolve the created pane.
- [`selectLayout`](/en/ts/latest/reference/window-window-selectlayout/) (method): Apply a named or custom layout.
- [`kill`](/en/ts/latest/reference/window-window-kill/) (method): Destroy this window, unlinking it from every session it is in.
- [`rename`](/en/ts/latest/reference/window-window-rename/) (method): Rename this window.
- [`link`](/en/ts/latest/reference/window-window-link/) (method): Link this window into another session, giving it a second placement.
- [`unlink`](/en/ts/latest/reference/window-window-unlink/) (method): Remove this placement, leaving the window's other placements intact.
- [`select`](/en/ts/latest/reference/window-window-select/) (method): Make this window active in its session.
- [`showOptions`](/en/ts/latest/reference/window-window-showoptions/) (method): Every option set on this window itself, not the ones it inherits.
- [`resize`](/en/ts/latest/reference/window-window-resize/) (method): Resize this window, by a direction, to a size, or to what its clients allow.
- [`move`](/en/ts/latest/reference/window-window-move/) (method): Move this window to another session or index without selecting it.
- [`rotate`](/en/ts/latest/reference/window-window-rotate/) (method): Rotate the panes within this window.
- [`showHooks`](/en/ts/latest/reference/window-window-showhooks/) (method): Read hooks set on this window itself.
- [`nextLayout`](/en/ts/latest/reference/window-window-nextlayout/) (method): Apply this window's next layout preset.
- [`respawn`](/en/ts/latest/reference/window-window-respawn/) (method): Restart the command running in this window's active pane.
- [`swapWith`](/en/ts/latest/reference/window-window-swapwith/) (method): Exchange positions with another window.
- [`activePane`](/en/ts/latest/reference/window-window-activepane/) (method): The pane tmux marks active in this window.
- [`setOption`](/en/ts/latest/reference/window-window-setoption/) (method): Set an option on this window.
- [`unsetOption`](/en/ts/latest/reference/window-window-unsetoption/) (method): Remove an option from this window.
- [`refreshed`](/en/ts/latest/reference/window-window-refreshed/) (method): This window placement, read again at a new instant.
- [`previousLayout`](/en/ts/latest/reference/window-window-previouslayout/) (method): Apply this window's previous layout preset.
- [`setHook`](/en/ts/latest/reference/window-window-sethook/) (method): Bind a tmux command to a window-scoped hook.
- [`unsetHook`](/en/ts/latest/reference/window-window-unsethook/) (method): Remove every command bound to a window-scoped hook.
- [`linkedSessions`](/en/ts/latest/reference/window-window-linkedsessions/) (method): Every session this window is linked into.
- [`cmd`](/en/ts/latest/reference/window-window-cmd/) (method): Run a tmux command this package does not model, addressed at this window.
- [`equals`](/en/ts/latest/reference/window-window-equals/) (method): Whether `other` is this same window on this same server.
- [`plan`](/en/ts/latest/reference/window-window-plan/) (method): The same mutations, described instead of run.
- [`removePlacement`](/en/ts/latest/reference/window-window-removeplacement/) (method): Remove this placement, destroying an unshared window but refusing a group.
- [`sameTmuxIdAs`](/en/ts/latest/reference/window-window-sametmuxidas/) (method): Whether `other` carries the same `@n`, wherever it came from.
- [`showResolvedOptions`](/en/ts/latest/reference/window-window-showresolvedoptions/) (method): The option values that govern this window, own and inherited together.
- [`unzoom`](/en/ts/latest/reference/window-window-unzoom/) (method): Restore this window's layout, whichever of its panes was zoomed.

### Other members

- [`constructor`](/en/ts/latest/reference/window-window-constructor/) (method)
- [`format`](/en/ts/latest/reference/window-window-format/) (property): The raw tmux format row, addressed by tmux's own token names.
- [`toString`](/en/ts/latest/reference/window-window-tostring/) (method): How this handle renders in a log line, a template literal, or an error.
- [`windowBrand`](/en/ts/latest/reference/window-window-windowbrand/) (attribute)

## Guides

Pages that discuss `Window`.

### Concepts

- [Server, session, window, pane](/en/ts/latest/concepts/server-session-window-pane/)

### Topics

- [Architecture](/en/ts/latest/topics/architecture/)

## In other ports

A tmux window

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window`](/en/py/latest/reference/libtmux-window/) (class) |
| Ruby | [`LibTmux::Window`](/en/ruby/latest/reference/libtmux-window-1vfx/) (class) |
| Lua | [`libtmux.Window`](/en/lua/latest/reference/libtmux-window/) (class) |
| PowerShell | [`LibTmux\Get-TmuxWindow`](/en/powershell/latest/reference/libtmux-get-tmuxwindow/) (cmdlet). This cmdlet reads shared .NET `LibTmux.Window` placements. Use [`-Server`](/en/powershell/latest/reference/libtmux-get-tmuxwindow/#LibTmux%5CGet-TmuxWindow.parameter.Server) for all sessions or [`-Session`](/en/powershell/latest/reference/libtmux-get-tmuxwindow/#LibTmux%5CGet-TmuxWindow.parameter.Session) for one session. |
| Julia | [`LibTmux.WindowSnapshot`](/en/julia/latest/reference/libtmux-windowsnapshot/) (struct). `WindowSnapshot` holds captured physical-window data. `WindowLink` records a placement in a session; actions use `WindowRef`. |
| Elixir | [`LibTmux.Window`](/en/elixir/latest/reference/libtmux-window/) (struct). `Window` is a physical window. `WindowLink` records its session index and active state. |
| Rust | [`window.Window`](/en/rs/latest/reference/window-window/) (struct) |
| Go | [`tmux.Window`](/en/go/latest/reference/tmux-window/) (struct) |
| Java | [`io.github.libtmux.Window`](/en/java/latest/reference/io-github-libtmux-window-window/) (class) |
| Kotlin | [`io.github.libtmux.kotlin.Window`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-window/) (class) |
| Scala | [`io.github.libtmux.scaladsl.Window`](/en/scala/latest/reference/io-github-libtmux-scaladsl-window/) (typealias) |
| C# | [`LibTmux.Window`](/en/csharp/latest/reference/libtmux-window/) (class) |
| F# | [`LibTmux.FSharp.Window`](/en/fsharp/latest/reference/libtmux-fsharp-window/) (module). This F# module identifies shared .NET `LibTmux.Window` placements and builds deferred pane queries. `Query.list` acquires their results from tmux. |
| C++ | [`libtmux::Window`](/en/cxx/latest/reference/libtmux-window/) (class) |
| Swift | [`Window`](/en/swift/latest/reference/window/) (struct) |
