# LibTmux::Server::kill_window

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Perl
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/core/lib/LibTmux/Server.pm#L1066
- **Page:** https://libtmux.org/en/perl/latest/reference/libtmux-server-kill_window/

```
sub kill_window($self, %args)
```

`kill_window(window => Window|window_id)`.

Destroy the physical [`LibTmux::Window`](/en/perl/latest/reference/libtmux-window/) and every [`LibTmux::WindowLink`](/en/perl/latest/reference/libtmux-windowlink/) referring to it. Use [`"unlink_window"`](/en/perl/latest/reference/libtmux-server-unlink_window/) when removing one association is the intended effect.

Returns `undef` after command acceptance. Performs I/O; failures propagate through [`LibTmux::X`](/en/perl/latest/reference/libtmux-x/). Captured objects are not modified.


```perl
    $server->kill_window(window => $window);
```

## Methods

## Parameters

- `args`

## tmux command

The tmux commands behind `kill_window`.

- [`display-message`](/en/tmux/latest/manual/display-message/) (daemon identity or target preflight)
- [`kill-window`](/en/tmux/latest/manual/kill-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_display_message_entry`](/en/tmux/latest/reference/c-variable-cmd_display_message_entry/) (attribute)
- [`cmd_display_message_exec`](/en/tmux/latest/reference/c-function-cmd-display-message-c-cmd_display_message_exec/) (function)
- [`cmd_kill_window_entry`](/en/tmux/latest/reference/c-variable-cmd_kill_window_entry/) (attribute)
- [`cmd_kill_window_exec`](/en/tmux/latest/reference/c-function-cmd-kill-window-c-cmd_kill_window_exec/) (function)

## In other ports

Close a window

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.kill`](/en/py/latest/reference/libtmux-window-kill/) (method) |
| Ruby | [`LibTmux::Window#kill`](/en/ruby/latest/reference/libtmux-window-kill/) (method) |
| Lua | [`libtmux.Window:kill`](/en/lua/latest/reference/libtmux-window-kill/) (method) |
| Erlang | [`tmux_window:kill/1`](/en/erlang/latest/reference/tmux_window-kill-1/) (function). Removes the physical window and its memberships. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`window.Window.kill`](/en/ts/latest/reference/window-window-kill/) (method) |
| Rust | [`window.Window.kill`](/en/rs/latest/reference/window-window-kill/) (method) |
| Go | [`tmux.Window.Kill`](/en/go/latest/reference/tmux-window-kill/) (method) |
| Java | [`io.github.libtmux.Window.kill`](/en/java/latest/reference/io-github-libtmux-window-window-kill/) (method) |
| C# | [`LibTmux.Window.KillAsync`](/en/csharp/latest/reference/libtmux-window-killasync/) (method) |
| C++ | [`libtmux::Window::kill`](/en/cxx/latest/reference/libtmux-window-kill/) (method) |
| Swift | [`Server.kill(_:)`](/en/swift/latest/reference/server-kill(_-)/) (method) |
| OCaml | [`Libtmux_unix.Client.kill_window`](/en/ocaml/latest/reference/libtmux_unix-client-kill_window/) (function) |

No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.
