Session.kill
Kill Session, closes linked windows and detach all clients.
Source and package
-
Description#
Examples#
Kill a session:
>>> session_1 = server.new_session()>>> session_1 in server.sessionsTrue>>> session_1.kill()>>> session_1 not in server.sessionsTrueKill 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.sessionsTrue- 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.
-
tmux command#
The tmux commands behind kill.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
End a session
| Language | Equivalent |
|---|---|
| Ruby | Lib |
| Lua | libtmux |
| Erlang | tmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | session |
| Rust | session |
| Go | tmux |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | Libtmux |
| Perl | Lib Explicit Server operation. Captured entities remain local observations; use a new snapshot to observe changes. |
No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.