Quickstart starts tmux with the CLI before using libtmux

未关闭 适合新手
#856 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
65/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
documentation

调研方向

从 README.md 中的「Open a tmux session」部分(约第 87-93 行)和 docs/quickstart.md 中的「Start a tmux session」部分(约第 107-116 行)开始,然后阅读其后的 libtmux.Server() 示例。在这两个文件中,将 tmux new-session 步骤替换为 libtmux.Server().new_session(session_name="foo", window_name="bar"),并将 tmux attach -t foo 命令保留为可选步骤。当两个页面都从 Python 创建会话时即完成。libtmux.org 启动器和任何新的上下文管理器 API 不在范围之内。

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
Python
星标
1.2k
派生
127
平均合并
2 小时 37 分钟
30 天内合并 PR
33

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tmux-python/libtmux 的其他 Issue

查看 tmux-python/libtmux 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。