Repository navigation
libtmux 0.69.0 leaves a running Server alive when exiting with Server() as server: unless kill_on_exit=True is set, preserves @ user-option values as strings in show_option() and show_options(), and hydrates empty tmux format fields on Session, Window, Pane, and Client as "" rather than None.
Highlights
- Scoping a
Serverpreserves the running daemon. Leavingwith Server() as server:previously killed whichever tmux server used that socket — including the default server and every session in it. Leaving the block now preserves the server on both normal and raising exits. Passkill_on_exit=Truewhen constructing a disposable server you want torn down on exit, or callServer.kill()directly.Session,Window, andPanecontext managers retain their existing teardown behavior (#728; see Context managers). @user options return strings. tmux stores every@user option as a string, whereasshow_option()andshow_options()previously coerced values such as"123","007","on", and"off"into integers or booleans and stripped escapes on multiline or tab-containing values. Both methods now return the stored string verbatim across server, session, window, and pane scopes (including inherited@name*reads viashow_option("@name", include_inherited=True)), while built-in options keep their numeric, boolean, and structured conversions (#826; see Options and hooks).- Empty tmux format fields read as
"". Fields that tmux reports as empty — such as a clearedPane.pane_titleor an unsetSession.session_group— now hydrate as""on initial queries and afterrefresh().Noneis reserved for format tokens that the listing command or running tmux version did not request (#900).
Upgrading
Opt into server teardown on exit when creating a throwaway socket:
with Server(socket_name="ci-build", kill_on_exit=True) as server:
server.new_session(session_name="runner")Convert @ user-option values explicitly when your application stores numbers or booleans:
retries = int(session.show_option("@retries"))
enabled = session.show_option("@enabled") == "on"Check empty string fields with truthiness rather than is None:
if not pane.pane_title:
pane.set_title("worker")See the migration notes and the changelog for the full list.
What's Changed
- Scoping a Server no longer kills it by @tony in #728
- neo(fix[parse_output]): Keep empty tmux fields as empty strings by @tony in #900
- options(fix): Preserve user-option strings by @tony in #826
Full Changelog: v0.68.0...v0.69.0