diff --git a/home-configs/claude/hooks/switch-account-hook.sh b/home-configs/claude/hooks/switch-account-hook.sh index ea3901f..a43e2c1 100755 --- a/home-configs/claude/hooks/switch-account-hook.sh +++ b/home-configs/claude/hooks/switch-account-hook.sh @@ -40,9 +40,9 @@ echo "$next" > "$CURRENT_FILE" echo "Аккаунт: ${current:-?} -> ${next} (всего: ${#accounts[@]})" >&2 -# Посылаем SIGWINCH процессу claude (дедушка: bash->sh->claude) +# Посылаем SIGWINCH процессу claude с задержкой в фоне (после отрисовки блокировки) sh_pid=$PPID claude_pid=$(awk '/PPid/{print $2}' /proc/$sh_pid/status 2>/dev/null) -[ -n "$claude_pid" ] && kill -WINCH "$claude_pid" 2>/dev/null || true +[ -n "$claude_pid" ] && ( sleep 0.3 && kill -WINCH "$claude_pid" 2>/dev/null ) & exit 2