On this page
tmux.Window.Kill
- Module
- tmux
- Declared in
- Window
- 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 stable window selected by the receiver's WindowID, removes all of its winlinks, and destroys its panes. Affected sessions preserve their current selection unless this window was current, in which case they select another. A session left without windows is destroyed;
Session.Killdescribes how tmux handles its clients. The receiver is not refreshed. Only stderr makes a completed command aCommandError; nonzero exits without stderr are ignored.In other languages Close a window
- Python
libtmux.Window.kill - TypeScript
window.Window.kill - Rust
window.Window.kill - Java
io.github.libtmux.Window.Window.kill - .NET
LibTmux.Window.KillAsync - C++
libtmux::Window::kill - Swift
Server.kill(_:)
- Python
Examples
Kill a window:
>>> window_1 = session.new_window() >>> window_1 in session.windows
True >>> window_1.kill() >>> window_1 not in session.windows
True Kill all windows except the current one:
>>> one_window_to_rule_them_all = session.new_window() >>> other_windows = session.new_window(
... ), session.new_window() >>> all([w in session.windows for w in other_windows])
True >>> one_window_to_rule_them_all.kill(all_except=True) >>> all([w not in session.windows for w in other_windows])
True >>> one_window_to_rule_them_all in session.windows
True await window.kill(); 0 declared, 0 inherited