Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

libtmux is picking up the wrong tmux version

未关闭
#396 14 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
cli

调研方向

Read libtmux/common.py around line 241 and the linked tmuxp report first; inspect how which combines default_paths with append_env_path. Done means the selected tmux executable follows the user's intended environment path rather than /usr/bin/tmux, addressing the reported protocol mismatch.

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

描述

See: https://github.com/tmux-python/tmuxp/issues/794

Started new server, protocol mismatch. tmuxp seems to be using /usr/bin/tmux instead of what I have aliased.

$ tmux -V
tmux.orig 2.8

$ /usr/bin/tmux -V
tmux 1.8

The problem for me is https://github.com/tmux-python/libtmux/blob/master/libtmux/common.py#L241
Your search paths are then placing the system paths AFTER the custom patch which tmux pulls up:

241     def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
242         tmux_bin = which(
243             "tmux",
244             default_paths=kwargs.get(
245                 "tmux_search_paths",
246                 ["/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin"],
247             ),
248             append_env_path=kwargs.get("append_env_path", True),
249         )

This really should be the other way around.

$ which tmux
tmux=/apollo/env/envImprovement/bin/tmux

I'd hate to have to fork this, so can we just perform a subprocess.run which tmux instead? Why do we need to search paths?

tmuxp:

-------------------------
environment:
        dist: Linux-5.4.204-124.362.amzn2int.x86_64-x86_64-with-glibc2.2.5
        arch: x86_64
        uname: Linux; dev-dsk-deguzim-1a-fa82568b.us-east-1.amazon.com; 5.4.204-124.362.amzn2int.x86_64
        version: #1 SMP Wed Jul 13 03:24:31 UTC 2022
-------------------------

tmux version: 1.8
libtmux version: 0.12.0
tmuxp version: 1.12.1
tmux path: /usr/bin/tmux
tmuxp path: /home/deguzim/.local/lib/python3.7/site-packages/tmuxp
shell: /bin/zsh
-------------------------
tmux sessions:

        protocol version mismatch (client 7, server 8)
tmux windows:

        protocol version mismatch (client 7, server 8)
tmux panes:

        protocol version mismatch (client 7, server 8)
tmux global options:

        protocol version mismatch (client 7, server 8)
tmux window options:

        protocol version mismatch (client 7, server 8)
主要语言
Python
星标
1.2k
派生
127
平均合并
2 小时 13 分钟
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

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

tmux-python/libtmux 的其他 Issue

查看 tmux-python/libtmux 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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