Skip to content

Claude Code Launcher: Load shell profiles in Ghostty and Alacritty adapters, update icon - #25693

Closed
jordiparra wants to merge 2 commits into
raycast:mainfrom
jordiparra:fix/load-shell-profiles
Closed

jordiparra wants to merge 2 commits into
raycast:mainfrom
jordiparra:fix/load-shell-profiles

Conversation

@jordiparra

Copy link
Copy Markdown
Contributor

Summary

  • Load shell profiles in Ghostty and Alacritty adapters: When these terminals are launched via the macOS open command, shell profiles (~/.zshrc, ~/.zprofile, etc.) are not automatically sourced. This causes environment variables like ANTHROPIC_API_KEY to be missing, resulting in "Missing API key" errors when launching Claude Code. The fix explicitly sources common shell profile files before running Claude.
  • Update extension icon: Updated to match current Claude Code branding.

Details

The Ghostty and Alacritty adapters both use open -na <App> --args -e $SHELL -l -c <command> to launch. While -l requests a login shell, the -c flag causes the shell to run in non-interactive mode, skipping ~/.zshrc and similar interactive profile files where users commonly set environment variables.

Terminal.app and Warp are not affected — Terminal.app opens a full login+interactive shell via AppleScript, and Warp manages its own shell environment through launch configurations.

The fix sources all common profile files with error suppression (2>/dev/null) so missing files are silently ignored:

source ~/.zprofile 2>/dev/null; source ~/.zshrc 2>/dev/null; source ~/.bash_profile 2>/dev/null; source ~/.bashrc 2>/dev/null; source ~/.profile 2>/dev/null;

Test plan

  • Launch Claude Code via Ghostty with an API key set only in ~/.zshrc — verify it loads without "Missing API key" error
  • Launch Claude Code via Alacritty with the same setup — verify it works
  • Launch Claude Code via Terminal.app — verify no regression
  • Launch Claude Code via Warp — verify no regression

🤖 Generated with Claude Code

Jordi Parra and others added 2 commits February 19, 2026 15:34
…apters, update icon

- Source shell profiles (~/.zprofile, ~/.zshrc, ~/.bash_profile, ~/.bashrc,
  ~/.profile) in Ghostty and Alacritty adapters before launching Claude Code
- Update extension icon to match Claude Code branding

When Ghostty or Alacritty are launched via macOS 'open' command with '-c'
(command mode), the shell runs non-interactively and skips loading profile
files like ~/.zshrc. This causes environment variables (e.g. ANTHROPIC_API_KEY)
to be unavailable, resulting in "Missing API key" errors.

The fix sources all common profile files with error suppression (2>/dev/null)
so missing files are silently ignored. Terminal.app and Warp are not affected
as they handle shell initialization differently.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Resize icon to 512x512 pixels (required by Raycast)
- Add changelog entries for shell profile loading fix and icon update
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: claude-code-launcher Issues related to the claude-code-launcher extension platform: macOS labels Feb 22, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @stephendolan @ridemountainpig 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="fix/load-shell-profiles"
FORK_URL="https://github.com/jordiparra/extensions.git"
EXTENSION_NAME="claude-code-launcher"
REPO_NAME="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

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@greptile-apps

greptile-apps Bot commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes environment variable loading (specifically ANTHROPIC_API_KEY) when launching Claude Code through Ghostty and Alacritty terminals, and updates the extension icon.

  • Shell profile loading fix: Added explicit sourcing of common shell profile files (~/.zprofile, ~/.zshrc, ~/.bash_profile, ~/.bashrc, ~/.profile) before launching Claude Code in both Ghostty and Alacritty adapters. The fix is necessary because using open -a with the -c flag causes shells to run in non-interactive mode, skipping interactive profile files where environment variables are typically set.
  • Icon update: Updated extension icon to match current Claude Code branding
  • Changelog format issue: The changelog uses [Unreleased] instead of a version number with the required {PR_MERGE_DATE} placeholder, violating repository standards

The implementation is sound - error suppression with 2>/dev/null ensures missing profile files don't cause failures, and the approach correctly addresses the root cause. Terminal.app and Warp adapters don't need this fix as they handle shell environments differently (AppleScript for Terminal.app, launch configurations for Warp).

Confidence Score: 4/5

  • Safe to merge after fixing the changelog format
  • The core implementation is solid and solves the environment variable loading problem correctly. The only issue is a changelog format violation that needs correction - using [Unreleased] instead of a version number with {PR_MERGE_DATE} placeholder
  • CHANGELOG.md requires format correction before merge

Important Files Changed

Filename Overview
extensions/claude-code-launcher/CHANGELOG.md Added changelog entries for shell profile fix and icon update, but format violates repository standards
extensions/claude-code-launcher/src/terminal-adapters/adapters/alacritty.ts Added shell profile sourcing to fix environment variable loading when launching via open command
extensions/claude-code-launcher/src/terminal-adapters/adapters/ghostty.ts Added shell profile sourcing to fix environment variable loading when launching via open command

Last reviewed commit: 0f1b7f0

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 22, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (1)

extensions/claude-code-launcher/CHANGELOG.md
Use version number with {PR_MERGE_DATE} instead of [Unreleased]

## [1.0.2] - {PR_MERGE_DATE}

Context Used: Rule from dashboard - What: Changelog entries must use {PR_MERGE_DATE} placeholder in titles, be placed at the top of th... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jordiparra 👋

Thanks for the contribution 🔥

Could you look into the suggestions from Greptile


I converted this PR into a draft until it's ready for the review, please press the button Ready for review when it's ready and we'll have a look 😊

@0xdhrv
0xdhrv marked this pull request as draft March 4, 2026 07:05
@raycastbot

Copy link
Copy Markdown
Collaborator

This pull request has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊

1 similar comment
@raycastbot

Copy link
Copy Markdown
Collaborator

This pull request has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Mar 18, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

This pull request has been automatically closed due to inactivity.

Feel free to comment in the thread when you're ready to continue working on it 🙂

You can also catch us in Slack if you want to discuss this.

@raycastbot raycastbot closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: claude-code-launcher Issues related to the claude-code-launcher extension extension fix / improvement Label for PRs with extension's fix improvements platform: macOS status: stalled Stalled due inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants