tmuxclihook 0.3.5 → 0.3.6

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.5",
3
+ "version": "0.3.6",
4
4
  "description": "交互式 TUI 安装器:环境侦测、AI CLI 侦测、tmux-ai-status hooks 装/卸/修、TPM 软链校验",
5
5
  "type": "module",
6
6
  "bin": {
@@ -197,7 +197,7 @@ _acquire_event_lock() {
197
197
  rmdir "$lock" 2>/dev/null
198
198
  continue
199
199
  fi
200
- mtime=$(stat -f %m "$lock" 2>/dev/null || stat -c %Y "$lock" 2>/dev/null)
200
+ mtime=$(stat -c %Y "$lock" 2>/dev/null || stat -f %m "$lock" 2>/dev/null)
201
201
  if [ -n "$mtime" ] && [ $(( $(date +%s) - mtime )) -ge 10 ]; then
202
202
  rm -f "$lock/owner" 2>/dev/null
203
203
  rmdir "$lock" 2>/dev/null
@@ -226,7 +226,7 @@ _acquire_lock() {
226
226
  fi
227
227
  # stale 检测: 锁目录 mtime > 5s 视为遗弃
228
228
  local mtime
229
- mtime=$(stat -f %m "$lock" 2>/dev/null || stat -c %Y "$lock" 2>/dev/null)
229
+ mtime=$(stat -c %Y "$lock" 2>/dev/null || stat -f %m "$lock" 2>/dev/null)
230
230
  if [ -n "$mtime" ]; then
231
231
  local age=$(( $(date +%s) - mtime ))
232
232
  if [ "$age" -ge 5 ]; then
@@ -379,7 +379,7 @@ _new_session_owns_pane() {
379
379
  [ "$stored_pane" = "$TMUX_PANE" ] || continue
380
380
  local mtime
381
381
  # stat 失败时保守视为新鲜(date +%s),避免误清活跃会话
382
- mtime=$(stat -f %m "$f" 2>/dev/null || stat -c %Y "$f" 2>/dev/null || date +%s)
382
+ mtime=$(stat -c %Y "$f" 2>/dev/null || stat -f %m "$f" 2>/dev/null || date +%s)
383
383
  local age=$(( $(date +%s) - mtime ))
384
384
  [ "$age" -ge 300 ] && ! _pane_has_ai_process "$TMUX_PANE" && continue
385
385
  return 0
@@ -435,7 +435,7 @@ _is_pane_session_dead() {
435
435
  [ -f "$f" ] || continue
436
436
  local mtime
437
437
  # stat 失败时保守视为新鲜(date +%s),避免误清活跃会话
438
- mtime=$(stat -f %m "$f" 2>/dev/null || stat -c %Y "$f" 2>/dev/null || date +%s)
438
+ mtime=$(stat -c %Y "$f" 2>/dev/null || stat -f %m "$f" 2>/dev/null || date +%s)
439
439
  local age=$(( $(date +%s) - mtime ))
440
440
  [ "$age" -lt 300 ] && return 1
441
441
  done