tmuxclihook 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmuxclihook",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "交互式 TUI 安装器:环境侦测、AI CLI 侦测、tmux-ai-status hooks 装/卸/修、TPM 软链校验",
5
5
  "type": "module",
6
6
  "bin": {
@@ -211,7 +211,8 @@ case "$EVENT" in
211
211
  exit 0
212
212
  ;;
213
213
  _session-switched)
214
- # client-session-changed hook(入口传 #{hook_client_name}):attach 与 switch-client
214
+ # client-session-changed hook(入口传 #{hook_client},3.7c/3.8 均为触发
215
+ # client 名;注意不存在 #{hook_client_name} 变量,误用恒为空):attach 与 switch-client
215
216
  # 的共同汇聚点(tmux server_client_set_session),两种「进入」都能捕获。
216
217
  # 该 hook 自指 switch 也触发(源码无 old != s 守卫)→ 用 per-client 自维护的
217
218
  # 上次 session 对比过滤:cur != prev 才算「真进入」,自指(cur == prev)跳过。
@@ -75,7 +75,10 @@ fi
75
75
  # client-session-changed: attach 与 switch-client 的共同汇聚点 = 「进入」→ 记
76
76
  # @ai_entered_time(排序用:刚进入的 session 排最后;handler 内以 per-client
77
77
  # 上次 session 对比过滤自指 switch)+ 刷新聚合
78
- tmux set-hook -g client-session-changed "run-shell '${CURRENT_DIR}/scripts/tmux-ai-status claude _session-switched #{hook_client_name}'" 2>/dev/null || true
78
+ # 变量必须用 #{hook_client}(3.7c/3.8 均展开为触发 client 名)。不存在
79
+ # #{hook_client_name} 这个 format 变量——误用它恒展开为空,handler 的
80
+ # [ -n "$3" ] 守卫静默跳过,entered_time 从不写入,排序退化为 created 序。
81
+ tmux set-hook -g client-session-changed "run-shell '${CURRENT_DIR}/scripts/tmux-ai-status claude _session-switched #{hook_client}'" 2>/dev/null || true
79
82
  # 注:_refresh 与 TOOL_ID 无关(仅重建聚合 + 自修复 claude hooks),统一传 claude。
80
83
  tmux set-hook -g session-closed "run-shell '${CURRENT_DIR}/scripts/tmux-ai-status claude _refresh'"
81
84
  tmux set-hook -g client-detached "run-shell '${CURRENT_DIR}/scripts/tmux-ai-status claude _refresh'"