From f6d529a1ab845946be5a49124a84092b684b321d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 1 Jul 2025 10:39:00 +0100 Subject: [PATCH] fix: Add error handling verification to vt title command - Add proper error checking after session.json update - Return appropriate exit codes on success/failure - Improve error messaging for better debugging --- mac/VibeTunnel/vt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mac/VibeTunnel/vt b/mac/VibeTunnel/vt index 69a9570c..35fbefe1 100755 --- a/mac/VibeTunnel/vt +++ b/mac/VibeTunnel/vt @@ -30,8 +30,15 @@ with open('$SESSION_FILE.tmp', 'w') as f: ESCAPED_TITLE=$(printf '%s' "$TITLE" | sed 's/[[\.*^$()+?{|]/\\&/g' | sed 's/"/\\"/g') sed -i.bak "s|\"name\":[^,}]*|\"name\":\"$ESCAPED_TITLE\"|" "$SESSION_FILE" && rm "$SESSION_FILE.bak" fi - echo "Session title updated to: $TITLE" - exit 0 + + # Verify the update was successful + if [ $? -eq 0 ]; then + echo "Session title updated to: $TITLE" + exit 0 + else + echo "Error: Failed to update session title" >&2 + exit 1 + fi else echo "Error: Session file not found at $SESSION_FILE" >&2 exit 1