On this page
libtmux.Session.kill
- Module
- libtmux
- Declared in
- Session
- Package
- libtmux
- Source
- src/libtmux/session.py
- Other languages
- TypeScriptRustGoJava.NETC++Swift
-
Kill
Session, closes linked windows and detach all clients.$ 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 TrueKill 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 (
-gflag). Requires tmux 3.7+. If used with tmux < 3.7, a warning is issued and the flag is ignored.
-
In other languages End a session
- TypeScript
session.Session.kill - Rust
session.Session.kill - Go
tmux.Session.Kill - Java
io.github.libtmux.Session.Session.kill - .NET
LibTmux.Session.KillAsync - C++
libtmux::Session::kill - Swift
Server.kill(_:)
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