From 3c247cab1585011cc6bda3f01acf5bbfd04c8aeb Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Fri, 20 Oct 2023 20:29:01 +0100 Subject: [PATCH] Use SIGKILL for stopping long git jobs. --- .bashrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bashrc b/.bashrc index 26574fc..4526b69 100644 --- a/.bashrc +++ b/.bashrc @@ -112,9 +112,9 @@ __prompt_git_status() { GIT_PROMPT_MARKER_SET=1 } [[ -z "$GIT_PROMPT_MARKER_SET" ]] && [[ -n "$GIT_PROMPT_SHOW_UNSTAGED" ]] && { - timeout 2s git ls-files --modified --exclude-standard --directory --error-unmatch -- ':/*' >/dev/null 2>&1 + timeout --signal=KILL 2s git ls-files --modified --exclude-standard --directory --error-unmatch -- ':/*' >/dev/null 2>&1 ERR=$? - if (( ERR == 124 )); then + if (( ERR == 124 )) || (( ERR == 137 )); then GIT_PROMPT+=" _" GIT_PROMPT_MARKER_SET=1 elif (( ERR == 0 )); then @@ -127,9 +127,9 @@ __prompt_git_status() { GIT_PROMPT_MARKER_SET=1 } [[ -z "$GIT_PROMPT_MARKER_SET" ]] && [[ -n "$GIT_PROMPT_SHOW_UNTRACKED" ]] && { - timeout 2s git ls-files git ls-files --others --exclude-standard --directory --error-unmatch -- ':/*' >/dev/null 2>&1 + timeout --signal=KILL 2s git ls-files git ls-files --others --exclude-standard --directory --error-unmatch -- ':/*' >/dev/null 2>&1 ERR=$? - if (( ERR == 124 )); then + if (( ERR == 124 )) || (( ERR == 137 )); then GIT_PROMPT+=" _" GIT_PROMPT_MARKER_SET=1 elif (( ERR == 0 )); then