On this page
LibTmux.Session.KillAsync
- Module
- LibTmux
- Declared in
- Session
- Package
- LibTmux
- Source
- src/LibTmux/Session.Lifecycle.cs
- Other languages
- PythonTypeScriptRustGoJavaC++Swift
- KillAsync ( allExcept : bool , clearAlerts : bool , group : bool , cancellationToken : CancellationToken ) Task
-
Stops this session.
Group stopping arrived in tmux 3.7. Older servers reject the flag and stop nothing at all, so against those the request is logged and the flag omitted: this session still dies, its group siblings do not.
- Parameters
-
-
allExcept ( bool ) – Whether every other session is stopped instead of this one.
-
clearAlerts ( bool ) – Whether alerts are cleared in every window instead.
-
group ( bool ) – Whether every session in this session's group is stopped.
-
cancellationToken ( CancellationToken ) – Cancels the tmux command.
-
- Raises
-
-
IncompleteSnapshotException –
groupis set on a handle resolved by identifier, which carries no server to read a version from.
-
In other languages End a session
- Python
libtmux.Session.kill - TypeScript
session.Session.kill - Rust
session.Session.kill - Go
tmux.Session.Kill - Java
io.github.libtmux.Session.Session.kill - 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