Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

Python documentation

View as Markdown

Module
libtmux
Declared in
Session
Package
libtmux
Source
src/libtmux/session.py
Other languages
RubyLuaTypeScriptRustGoJava.NETC++Swift
kill ( self , all_except : bool | None = None , clear : bool | None = None , group : bool | None = None ) → None
method [source]
method [source]
kill

Kill Session , closes linked windows and detach all clients.

$ tmux kill-session.

Parameters
  • all_except ( bool | None ) – Kill all sessions in server except this one.

  • clear ( bool | None ) – Clear alerts (bell, activity, or silence) in all windows.

  • group ( bool | None ) – Kill all sessions in this session's group (-g flag). Requires tmux 3.7+. If used with tmux < 3.7, a warning is issued and the flag is ignored.

In other ports End a session

Examples

Kill a session:

>>> session_1 = server.new_session()
>>> session_1 in server.sessions
True
>>> session_1.kill()
>>> session_1 not in server.sessions
True

Kill all sessions except the current one:

>>> one_session_to_rule_them_all = server.new_session()
>>> other_sessions = server.new_session(
... ), server.new_session()
>>> all([w in server.sessions for w in other_sessions])
True
>>> one_session_to_rule_them_all.kill(all_except=True)
>>> all([w not in server.sessions for w in other_sessions])
True
>>> one_session_to_rule_them_all in server.sessions
True
await session.kill();

0 declared, 0 inherited

Esc

Type to search.