# LibTmux.respawn_pane

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L257
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-respawn_pane/

```
respawn_pane(
    connection::LibTmux.ControlConnection,
    target::LibTmux.PaneRef;
    kill_running,
    command,
    shell_command,
    start_directory,
    kwargs...
)

respawn_pane(
    server::LibTmux.Server,
    target::LibTmux.PaneRef;
    kill_running,
    command,
    shell_command,
    start_directory,
    kwargs...
)
```

Restart the target's original command, or use explicit command argv or `shell_command`. Running processes are protected unless `kill_running=true`. Respawning a window reduces it to one pane; other pane references become stale. For shared windows, tmux chooses the session context used for the process environment. Return the command result without retry or rollback.

```julia
respawn_pane(server, target; kill_running=false, command=nothing,
           shell_command=nothing, start_directory=nothing, kwargs...)
```

## Methods

### `respawn_pane` (overload 1)

```julia
respawn_pane(
    connection::LibTmux.ControlConnection,
    target::LibTmux.PaneRef;
    kill_running,
    command,
    shell_command,
    start_directory,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control_topology.jl#L220).

Restart the original or supplied argv/shell command on the pinned daemon. Running processes require `kill_running=true`. Window respawn removes all but one pane. Options match the subprocess method; the fenced `ControlResult` proves tmux command completion, not completion of the new pane application.

```julia
respawn_pane(connection::ControlConnection, target; kwargs...)
```

### `respawn_pane` (overload 2)

```julia
respawn_pane(
    server::LibTmux.Server,
    target::LibTmux.PaneRef;
    kill_running,
    command,
    shell_command,
    start_directory,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/topology.jl#L242).

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `respawn_pane(connection, target, kill_running, command, shell_command, start_directory, kwargs)`)
- `target` (`LibTmux.PaneRef`)
- `kill_running` (`Bool`)
  Default: `false`.
- `command`
  Default: `nothing`.
- `shell_command`
  Default: `nothing`.
- `start_directory`
  Default: `nothing`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `respawn_pane(server, target, kill_running, command, shell_command, start_directory, kwargs)`)
