# LibTmux::Pane#respawn

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Ruby
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ruby/blob/da7b6191b9439e3c84fa1c9eeaa9168263ee7af4/gems/libtmux/lib/libtmux/operations.rb#L374
- **Page:** https://libtmux.org/en/ruby/v0.1.1/reference/libtmux-pane-respawn/

```
def respawn: (
  command: ::Array[::String],
  ?kill: bool,
  ?cwd: ::String?,
  ?environment: ::Hash[::String, ::String],
  ?timeout: ::Numeric,
  ?cancel: untyped
) -> ::LibTmux::CommandResult
```

Behavior: Entity mutation.

Behavior contract: Entity mutation.

## Parameters

- `command` (`::Array[::String]`)
- `kill` (`bool`)
- `cwd` (`::String?`)
- `environment` (`::Hash[::String, ::String]`)
- `timeout` (`::Numeric`)
- `cancel` (`untyped`)

## 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) |
| Lua | [`libtmux.Pane:respawn`](/en/lua/latest/reference/libtmux-pane-respawn/) (method) |
| 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) |

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