Skip to content

Conversation

@LSRCT
Copy link
Contributor

@LSRCT LSRCT commented Nov 6, 2025

No description provided.

LSRCT added 2 commits November 6, 2025 12:55
I've added auto setup for adding the cursor-agent binary to the PATH. Here's what was done:

   - Added a `ShellType` enum to represent bash and zsh shells
   - Added a `detect_shell()` function that detects the user's current shell from the `$SHELL` environment variable
   - Added a `config_file()` method on `ShellType` that returns the appropriate config file path (`~/.bashrc` for bash, `~/.zshrc` for zsh)

   - Modified `get_setup_helper_action()` to use the new shell detection
   - Added PATH configuration directly to the install script that:
     - Detects the user's shell in Rust (not bash)
     - Adds the export line to the appropriate shell config file
     - Sources the config file to make the PATH available immediately in the current session

   - Added `dirs = "5.0"` to reliably get the user's home directory

The implementation follows the pattern of doing shell detection in Rust (via `detect_shell()`) and keeping the bash script simpler, as requested. The PATH is now properly configured during the cursor-agent setup process.

Cleanup script changes for task attempt 4a4deda3-a27b-4635-9ab9-8aba961625f2

Done! I've simplified the implementation by:

1. **Removed the `ShellType` enum** - it was unnecessary complexity
2. **Created a simple `get_shell_config_file()` function** in `crates/utils/src/shell.rs` that:
   - Detects the shell from the `$SHELL` environment variable
   - Returns `~/.zshrc` for zsh, `~/.bashrc` for everything else
   - Returns `None` if the home directory can't be determined
3. **Updated cursor_setup.rs** to use this straightforward function instead of the enum

The code is now simpler and more direct, while still doing exactly what's needed for the PATH setup.

Cleanup script changes for task attempt 4a4deda3-a27b-4635-9ab9-8aba961625f2

All set! The changes have been applied and verified.

Perfect! The code compiles. Now the login script sources the config file before calling `cursor-agent login`, so the PATH will be properly set when the login command runs.
@LSRCT LSRCT force-pushed the vk/4a4d-fix-cursor-agent branch from c02955c to 10d44ff Compare November 6, 2025 12:56
@LSRCT LSRCT merged commit e2ca408 into main Nov 6, 2025
2 checks passed
@LSRCT LSRCT deleted the vk/4a4d-fix-cursor-agent branch November 6, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants