On this page
tmux.Session.Kill
- Module
- tmux
- Declared in
- Session
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/lifecycle_kill.go
- Other languages
- PythonTypeScriptRustJava.NETC++Swift
- Kill ( ctx : context.Context ) error
-
Kill destroys the receiver session and removes its winlinks. Ordinary attached clients detach; on tmux 3.6 or later, clients carrying no-detach-on-destroy move to another session when one exists. A window with no remaining links and all of that window's panes are also destroyed. The materialized receiver is not refreshed. Only stderr makes a completed command a
CommandError; nonzero exits without stderr are ignored. Transport errors are delivery-ambiguous. Kill is equivalent toSession.KillWithwith a zeroSessionKillRequest.In other languages End a session
- Python
libtmux.Session.kill - TypeScript
session.Session.kill - Rust
session.Session.kill - Java
io.github.libtmux.Session.Session.kill - .NET
LibTmux.Session.KillAsync - C++
libtmux::Session::kill - Swift
Server.kill(_:)
- Python
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