# LibTmux::Model::WindowRef.respawn

- **Module:** LibTmux::Model
- **Package:** LibTmux
- **Language:** Raku
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-raku/blob/0b5dd3d32e20f83a0069874e33eab0eb48f55962/lib/LibTmux/Model.rakumod#L213
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-model-windowref-respawn/

```
method respawn(Str :$shell-command, Str :$directory, Bool :$kill = False,
                   Associative:D :$environment = Map.new --> Result:D)
```

Restart the target's process; kill must be explicit when replacing a running process.

Restart the target's process; kill must be explicit when replacing a running process.

## Parameters

- `$shell-command?` (`Str`)
- `$directory?` (`Str`)
- `$kill?` (`Bool`)
- `$environment?` (`Associative:D`)

## tmux command

The tmux commands behind `respawn`.

- [`respawn-window`](/en/tmux/latest/manual/respawn-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_respawn_window_entry`](/en/tmux/latest/reference/c-variable-cmd_respawn_window_entry/) (attribute)
- [`cmd_respawn_window_exec`](/en/tmux/latest/reference/c-function-cmd-respawn-window-c-cmd_respawn_window_exec/) (function)

## In other ports

Restart the command in a window's active pane

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.respawn`](/en/py/latest/reference/libtmux-window-respawn/) (method) |
| Ruby | [`LibTmux::Window#respawn`](/en/ruby/latest/reference/libtmux-window-respawn/) (method) |
| Lua | [`libtmux.Window:respawn`](/en/lua/latest/reference/libtmux-window-respawn/) (method) |
| Erlang | [`tmux_window:respawn/2`](/en/erlang/latest/reference/tmux_window-respawn-2/) (function) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`window.Window.respawn`](/en/ts/latest/reference/window-window-respawn/) (method) |
| Rust | [`window.Window.respawn`](/en/rs/latest/reference/window-window-respawn/) (method) |
| Go | [`tmux.Window.Respawn`](/en/go/latest/reference/tmux-window-respawn/) (method) |
| Java | [`io.github.libtmux.Window.respawn`](/en/java/latest/reference/io-github-libtmux-window-window-respawn/) (method) |
| C# | [`LibTmux.Window.RespawnAsync`](/en/csharp/latest/reference/libtmux-window-respawnasync/) (method) |
| C++ | no equivalent on `Window` |
| Swift | no equivalent on `Window` |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |

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