Skip to content

Commit fb7f898

Browse files
committed
docs(CHANGES): Add bug fix entry for new_session() race condition (#625)
why: Document the fix for TmuxObjectDoesNotExist race condition in new_session() for the upcoming 0.54.x release. what: - Add Bug fixes section to 0.54.x changelog - Reference issue #624 and PR #625
1 parent 0f389ca commit fb7f898

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

CHANGES

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@ $ uvx --from 'libtmux' --prerelease allow python
3636
_Notes on the upcoming release will go here._
3737
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->
3838

39+
### Bug fixes
40+
41+
#### Fix race condition in new_session() (#625)
42+
43+
Fixed {exc}`~libtmux.exc.TmuxObjectDoesNotExist` raised by
44+
{meth}`~libtmux.Server.new_session` in some environments (e.g. PyInstaller-bundled
45+
binaries, Python 3.13+, Docker containers).
46+
47+
Previously, `new_session()` ran `tmux new-session -P -F#{session_id}` to create the
48+
session, then immediately issued a separate `list-sessions` query to hydrate the
49+
{class}`~libtmux.Session` object. In certain environments the session was not yet
50+
visible to `list-sessions`, causing a spurious failure.
51+
52+
The fix expands the `-F` format string to include all session fields and parses the
53+
`new-session -P` output directly into the returned `Session`, eliminating the
54+
follow-up query entirely. This is also one fewer subprocess call per session
55+
creation.
56+
57+
Closes: #624. Thank you @neubig!
58+
3959
### Development
4060

4161
#### Makefile -> Justfile (#617)

0 commit comments

Comments
 (0)