From ea1406e1f770b8e06b5aef4f36c7d6b665cbbfd0 Mon Sep 17 00:00:00 2001 From: Yakup Ozluk Date: Wed, 9 Sep 2026 17:49:31 +0300 Subject: [PATCH 1/2] terminal-helper: remove scripts after execution --- src/terminal-helper | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/terminal-helper b/src/terminal-helper index ad70a2d..5bcb4b9 100755 --- a/src/terminal-helper +++ b/src/terminal-helper @@ -37,7 +37,7 @@ done shift $(($OPTIND - 1)) file="$(mktemp)" -echo "$1" > "$file" +printf '%s\n' "$1" > "$file" cmd="${LAUNCHER_CMD} \"$file\"" echo $cmd @@ -77,5 +77,8 @@ if [ -z "$terminal" ]; then exit 1 fi -eval "${terminals[${terminal}]}" 2>/dev/null || [[ "$terminal" != "kgx" ]] && { rm "$file"; exit 2; } -rm "$file" +printf 'rm -f -- %q\n' "$file" >> "$file" +if ! eval "${terminals[${terminal}]}" 2>/dev/null && [[ "$terminal" != "kgx" ]]; then + rm "$file" + exit 2 +fi From df92f2bc8f09b09cdf672f8bff1e4c88b45acba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Yakup=20=C3=96zl=C3=BCk?= Date: Wed, 9 Sep 2026 18:02:28 +0300 Subject: [PATCH 2/2] Update rm command to use -f option for force removal Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/terminal-helper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminal-helper b/src/terminal-helper index 5bcb4b9..0a34d3e 100755 --- a/src/terminal-helper +++ b/src/terminal-helper @@ -77,8 +77,8 @@ if [ -z "$terminal" ]; then exit 1 fi -printf 'rm -f -- %q\n' "$file" >> "$file" +printf 'rm -f -- "$0"\n' >> "$file" if ! eval "${terminals[${terminal}]}" 2>/dev/null && [[ "$terminal" != "kgx" ]]; then - rm "$file" + rm -f -- "$file" exit 2 fi