Skip to content

Group Server members by purpose - #785

Open
tony wants to merge 2 commits into
masterfrom
server-overview
Open

tony wants to merge 2 commits into
masterfrom
server-overview

Conversation

@tony

@tony tony commented Oct 17, 2026

Copy link
Copy Markdown
Member

The Server API reference lists every member without saying which to reach for. This opens the Server docstring with what a server is, then adds a "What is on here" overview that groups each member by purpose, every name linked. The groups are connecting, finding one thing, listing everything, querying and traversal, changing things, options and hooks, everything else tmux keeps, and calls that need an attached terminal. The same structure is used on the Rust Server reference.

The overview states behaviour as it is today, each point checked on tmux 3.7d against throwaway sockets:

  • sessions, clients and attached_sessions read as empty on any tmux failure. The overview points to is_alive and raise_if_dead for telling that apart from an empty server.
  • kill_session matches a bare name as a prefix; =name matches exactly.
  • start_server on a dead socket leaves no server running, because tmux exits again under the default exit-empty.
  • The client-needing calls raise LibTmuxException without an attached client.

Two doctests are added: sessions.get(..., default=None), and an idle server whose sessions reads [] while is_alive() is False.

Validation:

  • ruff check and ruff format --check pass.
  • mypy passes.
  • The server.py doctests pass (42), and the full pytest suite passes (1453 passed, 3 skipped).
  • just build-docs reports 0 warnings.
  • A check of the built page found all 96 roles resolve and every public documented Server member linked.

@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.37%. Comparing base (e5cb17c) to head (b5e417b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #785   +/-   ##
=======================================
  Coverage   52.37%   52.37%           
=======================================
  Files          26       26           
  Lines        3729     3729           
  Branches      747      747           
=======================================
  Hits         1953     1953           
  Misses       1472     1472           
  Partials      304      304           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tony added 2 commits October 17, 2026 19:55
why: The Server page opened with a hierarchy list and one sentence, so
finding a member meant scanning all of them. It also never said that an
empty sessions, clients, or attached_sessions list can mean tmux is
unreachable.

what:
- Describe what a Server addresses, when it starts tmux, and that each
  list read runs a tmux command
- Add a "What is on here" overview that groups every public member under
  a bold lead-in, linked with :meth: and :attr:, and ends on cmd
- Point at is_alive and raise_if_dead to tell an empty list from a
  missing server
- Add two Examples doctests: get with default=None, and an idle server
  reading as empty
why: The unreleased entry did not record that the Server reference now
opens with a grouped member overview and states how an empty list reads
when tmux is unreachable.

what:
- Note the Server overview under Documentation

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant