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 摘要。