You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server(fix[__repr__]): Resolve socket dir from env
why: The repr fell through to a hard-coded /tmp/tmux-<euid>/default when
neither socket_name nor socket_path was given, which is every bare
Server(). tmux resolves its socket directory from $TMUX_TMPDIR, so under
a test harness, sandbox, or container the repr named a socket the object
was not talking to -- in tracebacks, --showlocals banners, and logs,
which is where someone is trying to tell servers apart. Closes#723.
what:
- Add libtmux._internal.env.resolve_socket_path(), which resolves
tmux-<euid>/<socket_name or "default"> under $TMUX_TMPDIR, else /tmp
($TMPDIR is not consulted, matching tmux)
- Resolve the socket directory through symlinks, as tmux does before
binding, so the path reported is the one tmux itself reports
- Use it for the Server.__repr__ fall-through, and for the socket unlink
in pytest_plugin._reap_test_server, which had to compute it inline
- Drop the getattr(self, 'socket_name', 'default') in the socket_name
branch, which had already established socket_name is not None
- Scope the doctest's $TMUX_TMPDIR patch to a monkeypatch.context(), so
it does not outlive the example and strand the fixture's server
- Add regression tests for $TMUX_TMPDIR and for a symlinked one
0 commit comments