fix: SIGWINCH точно в процесс claude (дедушка хука sh->claude)

bash(хук) -> sh -c -> claude. Шлём SIGWINCH через ppid от sh_pid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 21:17:06 +03:00
parent 76fb86f910
commit c86110fbd6

View File

@@ -40,8 +40,9 @@ echo "$next" > "$CURRENT_FILE"
echo "Аккаунт: ${current:-?} -> ${next} (всего: ${#accounts[@]})" >&2
# Посылаем SIGWINCH родительскому процессу claude чтобы он перерисовал статусную строку
ppid=$(ps -o ppid= -p $$ 2>/dev/null | tr -d ' ')
[ -n "$ppid" ] && kill -WINCH "$ppid" 2>/dev/null || true
# Посылаем SIGWINCH процессу claude (дедушка: bash->sh->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
exit 2