# LibTmux::Model::PaneRef.respawn

- **Module:** LibTmux::Model
- **Package:** LibTmux
- **Language:** Raku
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-raku/blob/0b5dd3d32e20f83a0069874e33eab0eb48f55962/lib/LibTmux/Model.rakumod#L339
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-model-paneref-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-pane`](/en/tmux/latest/manual/respawn-pane/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_respawn_pane_entry`](/en/tmux/latest/reference/c-variable-cmd_respawn_pane_entry/) (attribute)
- [`cmd_respawn_pane_exec`](/en/tmux/latest/reference/c-function-cmd-respawn-pane-c-cmd_respawn_pane_exec/) (function)

## In other ports

Restart a pane's command

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Pane.respawn`](/en/py/latest/reference/libtmux-pane-respawn/) (method) |
| Ruby | [`LibTmux::Pane#respawn`](/en/ruby/latest/reference/libtmux-pane-respawn/) (method) |
| Lua | [`libtmux.Pane:respawn`](/en/lua/latest/reference/libtmux-pane-respawn/) (method) |
| Erlang | [`tmux_pane:respawn/2`](/en/erlang/latest/reference/tmux_pane-respawn-2/) (function) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`pane.Pane.respawn`](/en/ts/latest/reference/pane-pane-respawn/) (method) |
| Rust | [`pane.Pane.respawn`](/en/rs/latest/reference/pane-pane-respawn/) (method) |
| Go | [`tmux.Pane.Respawn`](/en/go/latest/reference/tmux-pane-respawn/) (method) |
| Java | [`io.github.libtmux.Pane.respawn`](/en/java/latest/reference/io-github-libtmux-pane-pane-respawn/) (method) |
| C# | [`LibTmux.Pane.RespawnAsync`](/en/csharp/latest/reference/libtmux-pane-respawnasync/) (method) |
| C++ | [`libtmux::Pane::respawn`](/en/cxx/latest/reference/libtmux-pane-respawn/) (method) |
| Swift | [`Server.respawn(_:running:killingExisting:)`](/en/swift/latest/reference/server-respawn(_-running-killingexisting-)/) (method) |
| OCaml | [`Libtmux_unix.Client.respawn_pane`](/en/ocaml/latest/reference/libtmux_unix-client-respawn_pane/) (function) |
| 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#.
