extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Update `Terminal Finder` extension - error handling + Kitty support

Open xmok opened this issue 3 weeks ago • 1 comments

Lots of cool stuff!

sorta related to #23252 - if there are errors, they were not being shown. I have added some functions but still testing to make sure they work. The ones I have migrated I have tested ✅.

Description

  • A new quick command to jump from X to Y
  • Added README.md
  • Added support for Kitty
  • Updated command descriptions to be more precise
  • Added error handling in existing runAppleScript

Screencast

WIP

Checklist

xmok avatar Dec 23 '25 19:12 xmok

Thank you for your contribution! :tada:

🔔 @yedongze @Bibabidu @AnirudhG07 you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="ext/terminalfinder"
FORK_URL="https://github.com/xmok/raycast-extensions.git"
EXTENSION_NAME="terminalfinder"
REPO_NAME="raycast-extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

Due to our current reduced availability, the initial review may take up to 10-15 business days.

raycastbot avatar Dec 23 '25 19:12 raycastbot

Greptile Summary

This PR adds Kitty terminal support, creates a new unified X → Y quick command for dynamic terminal switching, and improves error handling across the extension. The changes consolidate duplicated code into reusable utility functions (clipboardToApplication, finderToApplication, applicationToFinder) and fix incorrect command descriptions that previously said "Finder directory" for clipboard commands.

Key changes:

  • Added Kitty terminal support with three new commands (clipboard→Kitty, Finder→Kitty, Kitty→Finder)
  • New X → Y command with dropdown arguments allowing users to select source and destination dynamically
  • Fixed error handling: replaced generic "Something went wrong" messages with showFailureToast that displays actual error details
  • Added stderr check in runAppleScript to properly surface AppleScript errors (addresses #23252)
  • Corrected command descriptions in package.json (clipboard commands now correctly say "Clipboard directory" instead of "Finder directory")
  • Refactored Warp and Ghostty commands to use shared utility functions for consistency
  • Added README documenting supported terminals

Issues found:

  • AppleScript error handling uses return instead of error in the new utility functions, causing "not running" messages to appear as success toasts instead of triggering error handlers

Confidence Score: 3/5

  • Safe to merge after fixing the AppleScript error handling issue
  • The PR successfully addresses the original error handling problem from #23252 by adding stderr checking and using showFailureToast. However, the new utility functions have a logical error where AppleScript returns strings instead of throwing errors when applications aren't running, causing confusing success messages. This is easily fixable and doesn't break existing functionality.
  • Pay close attention to extensions/terminalfinder/src/utils.ts - fix the return statements to use error instead

Important Files Changed

Filename Overview
extensions/terminalfinder/src/utils.ts Added error handling to runAppleScript (stderr check), refactored common logic into reusable functions (clipboardToApplication, finderToApplication, applicationToFinder)
extensions/terminalfinder/package.json Added Kitty support, new X → Y command, fixed command descriptions, updated dependencies and contributor list
extensions/terminalfinder/CHANGELOG.md Added new changelog entry with correct format and placeholder date
extensions/terminalfinder/src/index.ts New quick command handler for X → Y with dropdown arguments for dynamic terminal/finder switching

greptile-apps[bot] avatar Dec 26 '25 12:12 greptile-apps[bot]