# LibTmux\Remove-TmuxWindowLink

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

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

Remove one session placement of a window.

Remove only the session-relative link captured by the native [`Window`](/en/csharp/latest/reference/libtmux-window/) handle.
Other links to the same physical window remain. Without KillIfLast, tmux
refuses to remove the final link. With it, removing the final link also
destroys the window and its panes. Confirmation is requested by default.
[`WhatIf`](/en/powershell/latest/reference/libtmux-remove-tmuxwindowlink/#LibTmux%5CRemove-TmuxWindowLink.parameter.WhatIf) performs no tmux I/O.

### Notes

This command differs from [`Remove-TmuxWindow`](/en/powershell/latest/reference/libtmux-remove-tmuxwindow/), which kills the physical window
and all its links. The core verifies source placement and server generation in
tmux's native queue before unlinking. Stale or missing placements write a
per-input [`Tmux.WindowUnlinkFailed`](https://github.com/libtmux/libtmux-powershell/blob/b06c64f844f3173de66b187eaeaf3915814318c6/docs/reference/LibTmux/Remove-TmuxWindowLink.md#notes) error. [`ErrorAction`](/en/powershell/latest/reference/libtmux-remove-tmuxwindowlink/#LibTmux%5CRemove-TmuxWindowLink.parameter.ErrorAction) Continue permits later
inputs; [`ErrorAction`](/en/powershell/latest/reference/libtmux-remove-tmuxwindowlink/#LibTmux%5CRemove-TmuxWindowLink.parameter.ErrorAction) Stop stops at the first failure.

## 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`: One native window placement per pipeline input.
- **Outputs:** `System.Void`

Related APIs:

- [`Remove-TmuxWindow`](/en/powershell/latest/reference/libtmux-remove-tmuxwindow/)
- [`New-TmuxWindowLink`](/en/powershell/latest/reference/libtmux-new-tmuxwindowlink/)

## Examples

Example 1

Remove the selected $window placement from its session while retaining the
physical window through another link.

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

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

## Parameters

- `Window` (`LibTmux.Window`): The native placement to remove. It must identify the session and index that
still contain the captured 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).
- `KillIfLast` (`System.Management.Automation.SwitchParameter`): Allow tmux to destroy the physical window and its panes when this was its
last link. Without this switch, the last-link operation fails.
  Optional. Named parameter. Switch parameter. Does not accept pipeline input.
- `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.
