summaryrefslogtreecommitdiff
path: root/ar/.config/zsh/scripts.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.config/zsh/scripts.zsh')
-rw-r--r--ar/.config/zsh/scripts.zsh6
1 files changed, 4 insertions, 2 deletions
diff --git a/ar/.config/zsh/scripts.zsh b/ar/.config/zsh/scripts.zsh
index 3de8a14..6c217e8 100644
--- a/ar/.config/zsh/scripts.zsh
+++ b/ar/.config/zsh/scripts.zsh
@@ -450,8 +450,10 @@ function fzf_kill_process() {
awk '{print $2}' |
xargs -r bash -c '
if ! kill "$1" 2>/dev/null; then
- echo "Regular kill failed. Attempting with sudo..."
- sudo kill "$1" || echo "Failed to kill process $1" >&2
+ if ! kill -9 "$1"; then
+ echo "Regular kill failed. Attempting with sudo..."
+ sudo kill "$1" || echo "Failed to kill process $1" >&2
+ fi
fi
' --
}