Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## warn/bare-server-inherited-tmux #962 +/- ##
===================================================================
- Coverage 62.09% 62.08% -0.01%
===================================================================
Files 29 29
Lines 5105 5096 -9
Branches 1085 1080 -5
===================================================================
- Hits 3170 3164 -6
+ Misses 1595 1594 -1
+ Partials 340 338 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Dec 5, 2026
tony
force-pushed
the
warn/bare-server-inherited-tmux
branch
from
December 5, 2026 16:03
367d0d8 to
f836370
Compare
why: Bare Server() without socket_name or socket_path previously omitted -L/-S so inventory followed inherited $TMUX while new_session() deleted os.environ["TMUX"] in the parent process (#840). what: - Pass -Ldefault in Server._socket_args() and resolve Server.__repr__ against resolve_socket_path() when no socket selector is given - Add keyword env to tmux_cmd and isolate new_session() child env via ContextVar without mutating os.environ across threads - Promote MIGRATION table and examples from FutureWarning (#960) to enforced default (#840)
why: Record bare Server() -L default targeting and isolated child environments in the unreleased changelog. what: - Add Breaking changes and What's new entries for bare Server()
tony
force-pushed
the
feat/bare-server-default-socket
branch
from
December 5, 2026 16:15
aabca4d to
2294297
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Server()through-L defaultinstead of inherited$TMUX.Server.new_session()on the same socket.envtotmux_cmdfor isolated child environments.TMUXper child innew_session()without mutatingos.environ.MIGRATIONentry fromFutureWarningto enforced default.Fixes #840 (stacked on #961).
Changes
src/libtmux/common.py: accept optional keywordenvontmux_cmdand forward it tosubprocess.Popenwithout altering callers that omitenv.src/libtmux/server.py: pass-LdefaultinServer._socket_args()and resolveServer.__repr__viaresolve_socket_path()when neithersocket_namenorsocket_pathis set, drop theFutureWarningfrom Server(feat[socket]): Warn when bare Server() follows $TMUX #961, and isolateServer.new_session()'s child environment withcontextvars.ContextVarinstead of deletingos.environ["TMUX"].docs/topics/configuration.md,MIGRATION,CHANGES: document the enforced-L defaultbehavior,Server.from_env()migration path, and thread-safe child environment handling.tests/test_server.py: test two-server isolation with colliding$0session IDs, thread-synchronizedos.environ["TMUX"]preservation duringnew_session(),tmux_cmd(..., env=...), and$TMUX_TMPDIRsocket length checks.Design decisions
-LdefaultinServer._socket_args()rather than strippingTMUXglobally on every command. Intmux.c,-Ldefaultskipsgetenv("TMUX")and callsmake_label("default")withCLIENT_DEFAULTSOCKET, keeping child commands' pane environment intact unlessnew_session()explicitly stripsTMUX.new_session()'sTMUX-free environment via aContextVarread inServer.cmdso customServer.cmdsubclasses that accept noenvparameter continue working unchanged across threads.Test plan
Server()lists and creates sessions on-L defaultwhileServer.from_env(),-L, and-Scontrols stay isolated (test_bare_server_targets_default_socket_over_inherited_tmux)os.environ["TMUX"]duringnew_session()Popendispatch while childenvomitsTMUX(test_new_session_preserves_parent_tmux_env_across_threads,test_tmux_cmd_accepts_explicit_env)MIGRATION,docs/topics/configuration.md, anddocs/history.mddoctests pass underpytestruff,ty), and Sphinx docs (just build-docs) pass