# pane.Pane.killIfWindowUnshared

- **Module:** pane
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/pane.ts#L262
- **Page:** https://libtmux.org/en/ts/latest/reference/pane-pane-killifwindowunshared/

```
killIfWindowUnshared(): Promise<void>
```

Destroy this pane only if its window has one placement.

## Examples

```ts
await pane.killIfWindowUnshared();
```

## tmux command

The tmux commands behind `killIfWindowUnshared`.

- [`if-shell`](/en/tmux/latest/manual/if-shell/)
- [`kill-pane`](/en/tmux/latest/manual/kill-pane/) (the window has one placement)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_if_shell_entry`](/en/tmux/latest/reference/c-variable-cmd_if_shell_entry/) (attribute)
- [`cmd_if_shell_exec`](/en/tmux/latest/reference/c-function-cmd-if-shell-c-cmd_if_shell_exec/) (function)
- [`cmd_kill_pane_entry`](/en/tmux/latest/reference/c-variable-cmd_kill_pane_entry/) (attribute)
- [`cmd_kill_pane_exec`](/en/tmux/latest/reference/c-function-cmd-kill-pane-c-cmd_kill_pane_exec/) (function)
