# LibTmux\Get-TmuxWindow

- **Package:** LibTmux
- **Language:** PowerShell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/src/LibTmux.PowerShell/GetTmuxWindowCommand.cs#L7
- **Page:** https://libtmux.org/en/powershell/latest/reference/libtmux-get-tmuxwindow/

tmux command: [`list-windows`](/en/tmux/latest/manual/list-windows/)

```
Server (default):
Get-TmuxWindow
    [-Server] <LibTmux.Server>
    [-Id <System.String>]
    [-Name <System.String>]
    [<CommonParameters>]

Session:
Get-TmuxWindow
    [-Session] <LibTmux.Session>
    [-Id <System.String>]
    [-Name <System.String>]
    [<CommonParameters>]
```

Read contextual windows from a server or session.

Accept a native [`Server`](/en/csharp/latest/reference/libtmux-server/) or [`Session`](/en/csharp/latest/reference/libtmux-session/) as the owner. Each result retains its session placement. A linked window can therefore appear more than once. Id and Name are ordinal literal selectors; they do not expand wildcards.

### Notes

Global window identity differs from session-relative placement. Do not silently deduplicate results when placement index matters.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Default parameter set:** Server
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Server`: Native pipeline type for this command.; `LibTmux.Session`: Native pipeline type for this command.
- **Outputs:** `LibTmux.Window`

Related APIs:

- [Task guide](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/read.md)

## Examples

Example 1

List window placements on the existing server identified by $SocketPath.

[Source example](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux/Get-TmuxWindow.md).

```powershell
LibTmux\New-TmuxServer -SocketPath $SocketPath | LibTmux\Get-TmuxWindow
```

## Parameters

- `Server` (`LibTmux.Server`): The server whose windows are read. (for `Server`)
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).
- `Id` (`System.String`): An ordinal, literal window identifier selector.
  Optional. Named parameter. Does not accept pipeline input. [`ArgumentCompleter("LibTmux.PowerShell.WindowSelectorCompleter")`](https://learn.microsoft.com/dotnet/api/system.management.automation.argumentcompleterattribute?view=powershellsdk-7.4.0). [`ValidateNotNullOrEmpty()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnulloremptyattribute?view=powershellsdk-7.4.0).
- `Name` (`System.String`): An ordinal, literal window name selector.
  Optional. Named parameter. Does not accept pipeline input. [`ArgumentCompleter("LibTmux.PowerShell.WindowSelectorCompleter")`](https://learn.microsoft.com/dotnet/api/system.management.automation.argumentcompleterattribute?view=powershellsdk-7.4.0). [`ValidateNotNullOrEmpty()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnulloremptyattribute?view=powershellsdk-7.4.0).
- `Verbose` (`System.Management.Automation.SwitchParameter`): Display verbose messages produced by this command.
  Optional. Named parameter. Switch parameter. Common parameter. Does not accept pipeline input. Aliases: `vb`.
- `Debug` (`System.Management.Automation.SwitchParameter`): Display debug messages produced by this command.
  Optional. Named parameter. Switch parameter. Common parameter. Does not accept pipeline input. Aliases: `db`.
- `ErrorAction` (`System.Management.Automation.ActionPreference`): Choose how this command responds to non-terminating errors.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ea`.
- `WarningAction` (`System.Management.Automation.ActionPreference`): Choose how this command responds to warning messages.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `wa`.
- `InformationAction` (`System.Management.Automation.ActionPreference`): Choose how this command handles information messages.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `infa`.
- `ProgressAction` (`System.Management.Automation.ActionPreference`): Choose how this command handles progress updates.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `proga`.
- `ErrorVariable` (`System.String`): Store the command's error records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ev`.
- `WarningVariable` (`System.String`): Store the command's warning records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `wv`.
- `InformationVariable` (`System.String`): Store the command's information records in the named variable.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `iv`.
- `OutVariable` (`System.String`): Save output in the named variable while passing it down the pipeline.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ov`.
- `OutBuffer` (`System.Int32`): Buffer output before passing it to the next pipeline command.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `ob`.
- `PipelineVariable` (`System.String`): Make the most recent output object available through a named variable within the pipeline.
  Optional. Named parameter. Common parameter. Does not accept pipeline input. Aliases: `pv`.
- `Session` (`LibTmux.Session`): The session whose windows are read. (for `Session`)
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?view=powershellsdk-7.4.0).

## Returns

`LibTmux.Window`: Native pipeline type for this command.

## In other ports

### A tmux window

- 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`.
- 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)
- TypeScript: [`window.Window`](/en/ts/latest/reference/window-window/) (class)
- 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.Window`](/en/java/latest/reference/io-github-libtmux-window-window/) (class)
- C#: [`LibTmux.Window`](/en/csharp/latest/reference/libtmux-window/) (class)
- C++: [`libtmux::Window`](/en/cxx/latest/reference/libtmux-window/) (class)
- Swift: [`Window`](/en/swift/latest/reference/window/) (struct)
- 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)
- 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.

### List a session's windows

- Julia: [`LibTmux.windows`](/en/julia/latest/reference/libtmux-windows/) (function). `windows` with a captured `SessionSnapshot` reads distinct physical windows in that session. Use `windowlinks` for placements.
- Python: [`libtmux.Session.windows`](/en/py/latest/reference/libtmux-session-windows/) (property)
- Ruby: [`LibTmux::Session#list_windows`](/en/ruby/latest/reference/libtmux-session-list_windows/) (method)
- TypeScript: [`session.Session.windows`](/en/ts/latest/reference/session-session-windows/) (method)
- Rust: [`session.Session.windows`](/en/rs/latest/reference/session-session-windows/) (method)
- Go: [`tmux.Session.Windows`](/en/go/latest/reference/tmux-session-windows/) (method)
- Java: [`io.github.libtmux.Session.Session.windows`](/en/java/latest/reference/io-github-libtmux-session-session-windows/) (method)
- C#: [`LibTmux.Session.Windows`](/en/csharp/latest/reference/libtmux-session-windows/) (property)
- C++: [`libtmux::Session::windows`](/en/cxx/latest/reference/libtmux-session-windows/) (method)
- Swift: [`Snapshot.windows(of:)`](/en/swift/latest/reference/snapshot-windows(of-)/) (method)
- Kotlin: [`io.github.libtmux.kotlin.Session.windows`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-session-windows/) (property)
- Scala: [`io.github.libtmux.scaladsl.Session.windows`](/en/scala/latest/reference/io-github-libtmux-scaladsl-session-windows/) (method)
- F#: [`LibTmux.FSharp.Session.windows`](/en/fsharp/latest/reference/libtmux-fsharp-session-windows/) (function). Builds a deferred window query from one `LibTmux.Session` and its server. `Query.list` acquires placements scoped to that session ID.

### List the server's windows

- Julia: [`LibTmux.windows`](/en/julia/latest/reference/libtmux-windows/) (function). `windows` with a `Snapshot` reads every captured physical window. Use `windowlinks` for session placements.
- Python: [`libtmux.Server.windows`](/en/py/latest/reference/libtmux-server-windows/) (property)
- Ruby: [`LibTmux::Server#list_windows`](/en/ruby/latest/reference/libtmux-server-list_windows/) (method)
- Lua: [`libtmux.Snapshot.windows`](/en/lua/latest/reference/libtmux-snapshot-windows/) (attribute)
- TypeScript: [`server.Server.windows`](/en/ts/latest/reference/server-server-windows/) (method)
- Rust: [`server.Server.windows`](/en/rs/latest/reference/server-server-windows/) (method)
- Go: [`tmux.Server.Windows`](/en/go/latest/reference/tmux-server-windows/) (method)
- Java: [`io.github.libtmux.Server.Server.windows`](/en/java/latest/reference/io-github-libtmux-server-server-windows/) (method)
- C#: [`LibTmux.Server.Windows`](/en/csharp/latest/reference/libtmux-server-windows/) (property)
- C++: [`libtmux::Server::windows`](/en/cxx/latest/reference/libtmux-server-windows/) (method)
- Swift: [`Server.windows()`](/en/swift/latest/reference/server-windows()/) (method)
- Kotlin: [`io.github.libtmux.kotlin.Server.windows`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-server-windows/) (method)
- Scala: [`io.github.libtmux.scaladsl.Server.windows`](/en/scala/latest/reference/io-github-libtmux-scaladsl-server-windows/) (method)
- F#: [`LibTmux.FSharp.Server.windows`](/en/fsharp/latest/reference/libtmux-fsharp-server-windows/) (function). Builds a deferred query for placements across all sessions. `Query.list` acquires the results; a linked window appears once for each session placement.
