Core LibrarystableAPI Reference

Choose documentation 3

stable

Current version

stable
English

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

Python API

method libtmux stable

Session.kill

Kill Session , closes linked windows and detach all clients.

Source and package
Qualified name
libtmux.Session.kill
Module
libtmux
Declared in
Session
Package
libtmux
Source
src/libtmux/session.py
Other languages
PowerShell Julia RubyLuaTypeScriptRustGoJavaC#C++Swift Kotlin Scala F#
kill ( self, all_except: bool | None = None, clear: bool | None = None, group: bool | None = None, ) → None

Description#

$ tmux kill-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
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.

tmux command kill-session

In other ports End a session
Esc

Type to search.

Reference preview Open reference