Quickstart starts tmux with the CLI before using libtmux

Ouverte Adaptée aux débutants
#856 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
65/100
Type d'issue
Documentation
Clarté
Plutôt claire
Activité
Active
Stack technique
python
Domaine
documentation

Piste de recherche

Commence par la section « Open a tmux session » de README.md (vers les lignes 87-93) et la section « Start a tmux session » de docs/quickstart.md (vers les lignes 107-116), puis lis les exemples libtmux.Server() qui suivent. Dans les deux fichiers, remplace l'étape tmux new-session par libtmux.Server().new_session(session_name="foo", window_name="bar") et conserve la commande tmux attach -t foo comme étape facultative. C'est terminé lorsque les deux pages créent la session depuis Python. Le lanceur libtmux.org et toute nouvelle API de gestionnaire de contexte sont hors périmètre.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Summary

The README and docs/quickstart.md start with "First, start a tmux session to connect to" and a tmux new-session command, then use libtmux.Server(). libtmux can create that session itself. The maintainer asked on 2026-11-14 that ports not send users to a shell script when the library could do the job. Severity is low: the quickstart's point is piloting a session the reader attaches to in another terminal, so the shell command is part of the story.

Expected
  • The quickstart creates the session from Python: server = libtmux.Server(); session = server.new_session(session_name="foo", window_name="bar"), then tells the reader how to attach (tmux attach -t foo) as an optional step.
  • The libtmux.org "Attaching to tmux" program creates work itself and connects a second Server handle to the same socket.
Actual
  • README.md L91: tmux new-session -s foo -n bar under "Open a tmux session".
  • docs/quickstart.md L111: tmux new-session -n bar -s foo under "Start a tmux session", with the tutorial using session foo and window bar.
  • libtmux.org (libtmux/docs) shows a run.sh launcher on the Python "Attaching to tmux" guide (ports/py/guides/attaching-to-tmux.md L50-76) and an environment scrub before the landing example (home-examples.json L24). The Python landing program does not need either: it uses libtmux.Server(socket_path=..., config_file="/dev/null"), new_session, and cleans up in finally.
Proposal

None. Server.new_session, Server.kill, Server(socket_path=..., config_file=...) exist. Optional: a public, non-pytest context manager for a private server (the pytest plugin's TestServer is test-only), for example libtmux.Server.private(root=None, config_file="/dev/null") that creates a temp directory, yields a Server, kills it and removes the directory on exit.

References
  • Maintainer, 2026-11-14: "don't spam shell script to users"; file an issue per repo and name the missing APIs.
  • libtmux/docs launcher issue; related existing issues tmux-python/libtmux#804 (create or reuse tmux resources with explicit cleanup ownership) and #823.
Langage dominant
Python
Étoiles
1.2k
Forks
127
Merge moyen
2 h 37 min
PR mergées (30 j)
33

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de tmux-python/libtmux

Toutes les issues de tmux-python/libtmux

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.