Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

Unreleased libtmux_erlang has not been released. Its API may change during development. This site's structure and URLs may change too.

function libtmux-erlang latest

tmux_pane:respawn/2

Respawn this registered physical pane, keeping its pane ID. force defaults false and a running pane normally returns command_error. force = true lets tmux close its existing PTY before spawning again. This acknowledges the tmux command, not former-job termination or successful application initialization. The old PTY can already be closed if a later spawn step fails.

Source and package
Qualified name
tmux_pane:respawn/2
Declared in
tmux_pane
Package
libtmux_erlang
Source
apps/libtmux_erlang/src/tmux_pane.erl
Other languages
Perl PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptRustGoJavaC#C++Swift Kotlin Scala OCaml F# Clojure
respawn(Pane, Options) -spec respawn(tmux_model:pane(), respawn_options()) -> {ok, tmux_operation:completed()} | {error, tmux_operation:failure()}.

Description#

launch defaults to previous, reusing tmux's saved argv or shell. An explicit argv or shell map replaces that command. default_shell is invalid here because absent respawn arguments mean saved-command reuse. Omitted cwd retains the saved launch directory, rather than the program's current directory. env augments the session environment tmux resolves for this physical pane; a captured membership does not pin that context. Prior per-spawn overrides are not automatically reapplied. Other launch rules follow tmux_session:create/2.

Performs I/O after validation. Existing rows retain their observations; use get/2 and an application readiness condition to inspect the new process. An uncertain result is not permission to replay this mutation automatically.

Unsupported launch modes fail before dispatch:

Examples#

1> tmux_pane:respawn(invalid_row, #{launch => default_shell}).
{error,#{code => invalid_launch}}

tmux command#

The tmux commands behind respawn/2.

tmux C API#

The C declarations in tmux that implement these commands.

Guides#

Pages that discuss respawn/2.

In other ports#

Restart a pane's command

Equivalents of Restart a pane's command in other languages
Language Equivalent
Python libtmux.Pane.respawn
Ruby LibTmux::Pane#respawn
Lua libtmux.Pane:respawn
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript pane.Pane.respawn
Rust pane.Pane.respawn
Go tmux.Pane.Respawn
Java io.github.libtmux.Pane.respawn
C# LibTmux.Pane.RespawnAsync
C++ libtmux::Pane::respawn
Swift Server.respawn(_:running:killingExisting:)
OCaml Libtmux_unix.Client.respawn_pane
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#.

Esc

Type to search.

Reference previewOpen reference