Add smart terminal selection for --enhance-local with cascading priority: 1. SKILL_SEEKER_TERMINAL env var (explicit user preference) 2. TERM_PROGRAM env var (inherit current terminal) 3. Terminal.app (fallback default) Supports Ghostty, iTerm2, WezTerm, and Terminal.app. Includes comprehensive test suite (11 tests) and user documentation. Changes: - Add detect_terminal_app() function with priority-based selection - Support for 4 major macOS terminals via TERMINAL_MAP - Fallback handling for unknown terminals (IDE terminals) - Add TERMINAL_SELECTION.md with setup examples and troubleshooting - Update README.md to link to terminal selection guide - Full test coverage for all detection paths and edge cases
2.4 KiB
Terminal Selection Guide
When using --enhance-local, Skill Seeker opens a new terminal window to run Claude Code. This guide explains how to control which terminal app is used.
Priority Order
The script automatically detects which terminal to use in this order:
SKILL_SEEKER_TERMINALenvironment variable (highest priority)TERM_PROGRAMenvironment variable (inherit current terminal)- Terminal.app (fallback default)
Setting Your Preferred Terminal
Option 1: Set Environment Variable (Recommended)
Add this to your shell config (~/.zshrc or ~/.bashrc):
# For Ghostty users
export SKILL_SEEKER_TERMINAL="Ghostty"
# For iTerm users
export SKILL_SEEKER_TERMINAL="iTerm"
# For WezTerm users
export SKILL_SEEKER_TERMINAL="WezTerm"
Then reload your shell:
source ~/.zshrc # or source ~/.bashrc
Option 2: Set Per-Session
Set the variable before running the command:
SKILL_SEEKER_TERMINAL="Ghostty" python3 cli/doc_scraper.py --config configs/react.json --enhance-local
Option 3: Inherit Current Terminal (Automatic)
If you run the script from Ghostty, iTerm2, or WezTerm, it will automatically open the enhancement in the same terminal app.
Note: IDE terminals (VS Code, Zed, JetBrains) use unique TERM_PROGRAM values, so they fall back to Terminal.app unless you set SKILL_SEEKER_TERMINAL.
Supported Terminals
- Ghostty (
ghostty) - iTerm2 (
iTerm.app) - Terminal.app (
Apple_Terminal) - WezTerm (
WezTerm)
Example Output
When terminal detection works:
🚀 Launching Claude Code in new terminal...
Using terminal: Ghostty (from SKILL_SEEKER_TERMINAL)
When running from an IDE terminal:
🚀 Launching Claude Code in new terminal...
⚠️ unknown TERM_PROGRAM (zed)
→ Using Terminal.app as fallback
Tip: Set SKILL_SEEKER_TERMINAL to avoid the fallback behavior.
Troubleshooting
Q: The wrong terminal opens even though I set SKILL_SEEKER_TERMINAL
A: Make sure you reloaded your shell after editing ~/.zshrc:
source ~/.zshrc
Q: I want to use a different terminal temporarily
A: Set the variable inline:
SKILL_SEEKER_TERMINAL="iTerm" python3 cli/doc_scraper.py --enhance-local ...
Q: Can I use a custom terminal app?
A: Yes! Just use the app name as it appears in /Applications/:
export SKILL_SEEKER_TERMINAL="Alacritty"