v0.44.0 - Context managers
What's Changed
Support for context managers
Added context manager support for all main tmux objects:
Server
: Automatically kills the server when exiting the contextSession
: Automatically kills the session when exiting the contextWindow
: Automatically kills the window when exiting the contextPane
: Automatically kills the pane when exiting the context
Example usage:
with Server() as server:
with server.new_session() as session:
with session.new_window() as window:
with window.split() as pane:
pane.send_keys('echo "Hello"')
# Do work with the pane
# Everything is cleaned up automatically when exiting contexts
This makes it easier to write clean, safe code that properly cleans up tmux resources.
Full Changelog: v0.43.0...v0.44.0