Skip to content

v0.1.1

Choose a tag to compare

@atomicstack atomicstack released this 20 Mar 21:42
· 24 commits to main since this release

empty-server control-mode startup fix

this release fixes a constructor bug in gotmuxcc.NewTmux() / NewTmuxWithOptions() when connecting to a tmux server that has no existing sessions.

previously, gotmuxcc could fall through to bare tmux -C during startup. tmux interprets that as an implicit new-session, which created an unwanted session as a side effect of opening the control-mode connection.

fixes

  • use an explicit startup plan instead of falling through to bare tmux -C
  • attach to an existing session when one is available
  • when no sessions exist, create a uniquely named detached bootstrap session instead of consuming the next numeric session name such as 0
  • propagate unexpected list-sessions discovery failures as constructor errors instead of silently treating them as "no sessions"
  • clean up the bootstrap session with a best-effort kill-session when the Tmux handle is closed

tests

  • added unit coverage for existing-session startup
  • added unit coverage for empty-server bootstrap startup
  • added unit coverage for discovery error propagation
  • added unit coverage for bootstrap-session cleanup on Close()

caveat

if a caller keeps a Tmux handle open while the server still has no real user sessions, the named bootstrap session may remain visible until Close() is called. this avoids stealing the first numeric session name and keeps the control-mode client alive, but it is not yet an immediate auto-retirement of the bootstrap session.

commit

  • 9111a04 fix: avoid phantom tmux sessions on empty servers