generated from nhcarrigan/template
fix: execute Claude CLI commands through WSL on Windows #139
Reference in New Issue
Block a user
Delete Branch "fix/windows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #137
Summary
Claude CLI commands (plugin list, MCP list, version check, etc.) were being executed directly in Windows context where the
claudebinary doesn't exist, causing "program not found" errors across the UI.This PR adds a helper function that automatically prefixes commands with
wslon Windows builds, ensuring all Claude CLI commands execute in the correct context.Changes
Added
create_claude_command()helper function that:wsl claudeprefixclaudedirectlyUpdated 8 command functions to use the helper:
get_claude_versionlist_pluginsinstall_pluginuninstall_pluginlist_mcp_serversremove_mcp_serveradd_mcp_serverget_mcp_server_detailsAdded comprehensive tests for both Windows and Linux contexts
What This Fixes
✅ Memory pane will now display files correctly
✅ CLI version will be detected properly
✅ Plugin pane will work correctly
✅ MCP servers pane will function properly
✅ All Claude CLI commands will execute in the correct context on Windows
Testing
check-all.shreports: "✨ All checks passed!"✨ This fix was created by Hikari~ 🌸
Previously hardcoded `/home/naomi/.local/bin/claude` which would break for other users. Now uses `wsl -e bash -l -c "which claude"` to find the Claude binary dynamically using a login shell that has the full PATH. Also updated 6 plugin/marketplace functions that were still using `std::process::Command::new("claude")` directly instead of the `create_claude_command()` helper: - enable_plugin - disable_plugin - update_plugin - list_marketplaces - add_marketplace - remove_marketplace This ensures all Claude CLI commands work properly on Windows regardless of where Claude is installed, whilst maintaining backwards compatibility. ✨ This fix was created by Hikari~ 🌸