From 9ad82ca5267538c66d5d9d2eec26182975bf67db Mon Sep 17 00:00:00 2001 From: j Date: Sun, 15 Mar 2026 13:24:31 +1300 Subject: [PATCH] fix: Return exit code 0 on success when running without TTY (e.g. background execution) --- gp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gp b/gp index 2aafd9a..ecd3337 100755 --- a/gp +++ b/gp @@ -563,7 +563,7 @@ wait_for_workflow() { stty -echo -icanon min 0 time 0 2>/dev/null || true # Restore terminal on exit - trap 'stty "$old_tty" 2>/dev/null; trap - RETURN' RETURN + trap 'stty "$old_tty" 2>/dev/null || true; trap - RETURN' RETURN local run_url="" run_id="" found=false local prev_lines=0 # track how many lines we printed last time @@ -986,6 +986,7 @@ main() { # Execute the commit and push do_commit_and_push "$commit_message" "$TARGET_BRANCH" + exit 0 } # Run main function