libtmux Reference MCP Search
On this page

libtmux.Window.respawn

View as Markdown

Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
respawn ( self , shell : str | None = None , start_directory : StrPath | None = None , environment : dict[str, str] | None = None , kill : bool | None = None ) None
method [source]
method [source]
respawn

Respawn the window process via $ tmux respawn-window.

Examples

>>> window = session.new_window(window_name='respawn_test')
>>> window.respawn(kill=True, shell='sh')
Parameters
  • shell ( str | None ) – Shell command to run in the respawned window.

  • start_directory ( StrPath | None ) – Working directory for the respawned window (-c flag).

  • environment ( dict[str, str] | None ) – Environment variables (-e flag).

  • kill ( bool | None ) – Kill the current process before respawning (-k flag). Required if the window is still active.

0 declared, 0 inherited

Esc

Type to search.