# LibTmux\Remove-TmuxWindow

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

```
Remove-TmuxWindow
    [-Window] <LibTmux.Window>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
```

Remove a physical window and all its session links.

Remove the supplied native [`LibTmux.Window`](/en/csharp/latest/reference/libtmux-window/) from every session that links it,
including repeated links in the same session. This destroys its panes. To
remove only one session placement, use [`Remove-TmuxWindowLink`](/en/powershell/latest/reference/libtmux-remove-tmuxwindowlink/);
this command always kills the physical window.

The endpoint and daemon generation come from the native handle. This
high-impact operation requests confirmation by default. [`WhatIf`](/en/powershell/latest/reference/libtmux-remove-tmuxwindow/#LibTmux%5CRemove-TmuxWindow.parameter.WhatIf) performs no
acquisition or mutation. Cancellation does not restore removed resources.

### Notes

Failures use [`Tmux.WindowRemoveFailed`](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux/Remove-TmuxWindow.md#notes) and retain the original core exception,
its dispatch information and the failed owner. [`ErrorAction`](/en/powershell/latest/reference/libtmux-remove-tmuxwindow/#LibTmux%5CRemove-TmuxWindow.parameter.ErrorAction) Continue permits
later owners to be processed; [`ErrorAction`](/en/powershell/latest/reference/libtmux-remove-tmuxwindow/#LibTmux%5CRemove-TmuxWindow.parameter.ErrorAction) Stop stops on the first failure.
A missing target remains an error. No mutation is retried. Previously captured
handles retain their old data after removal and are not refreshed in place.

## Command details

- **Command type:** [`cmdlet`](/en/powershell/latest/reference/glossary/#cmdlet)
- **Confirmation:** Supports `-WhatIf` and `-Confirm`; confirm impact: High.
- **Positional binding:** Enabled.
- **Pipeline inputs:** `LibTmux.Window`: A native LibTmux.Window selected from an explicit endpoint.
- **Outputs:** `System.Void`

Related APIs:

- [Remove sessions, windows and panes](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/remove.md)
- [Choose endpoints and owners](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/read.md)

## Examples

Example 1

Remove the previously selected native $window from an endpoint you own.
This example explicitly suppresses confirmation; omitting Confirm uses the
normal high-impact confirmation behavior.

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

```powershell
$window | LibTmux\Remove-TmuxWindow -Confirm:$false
```

## Parameters

- `Window` (`LibTmux.Window`): The native physical window to remove from every session. A handle acquired
through one session still identifies the shared physical window.
  Required. Position 0. Accepts pipeline input by value. [`ValidateNotNull()`](https://learn.microsoft.com/dotnet/api/system.management.automation.validatenotnullattribute?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`.
- `WhatIf` (`System.Management.Automation.SwitchParameter`): Runs the command in a mode that only reports what would happen without performing the actions.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input. Aliases: `wi`.
- `Confirm` (`System.Management.Automation.SwitchParameter`): Prompts you for confirmation before running the cmdlet.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input. Aliases: `cf`.

## Returns

`None`: No success objects are emitted. An empty input pipeline performs no work.
