# LibTmux::Pane#respawn

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

tmux command: [`respawn-pane`](/en/tmux/latest/manual/respawn-pane/)

```
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`)

## In other ports

### Restart a pane's command

- 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.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)
