120 lines
3.4 KiB
Markdown
120 lines
3.4 KiB
Markdown
|
|
# Code Command Wrapper Status
|
||
|
|
|
||
|
|
## Current Status: ✅ Functional with Limitations
|
||
|
|
|
||
|
|
The `code` command wrapper has been successfully created and is working. However, it cannot automatically open files in Cursor because Cursor is not in the Windows PATH.
|
||
|
|
|
||
|
|
## What Works
|
||
|
|
|
||
|
|
✅ **Command Availability**
|
||
|
|
- `code` command is available: `/home/intlc/.local/bin/code`
|
||
|
|
- Version flag works: `code --version`
|
||
|
|
- Help flag works: `code --help`
|
||
|
|
- Command is in PATH
|
||
|
|
|
||
|
|
✅ **Path Conversion**
|
||
|
|
- Correctly converts WSL paths to Windows UNC paths
|
||
|
|
- Handles both absolute and relative paths
|
||
|
|
- Supports file and directory targets
|
||
|
|
|
||
|
|
✅ **Error Messages**
|
||
|
|
- Provides clear, helpful error messages
|
||
|
|
- Shows both WSL and Windows path formats
|
||
|
|
- Gives actionable instructions
|
||
|
|
|
||
|
|
## Limitations
|
||
|
|
|
||
|
|
⚠️ **Cannot Auto-Open Files**
|
||
|
|
- Cursor.exe is not in Windows PATH
|
||
|
|
- Cannot launch Cursor from WSL command line
|
||
|
|
- Requires manual file opening in Cursor
|
||
|
|
|
||
|
|
## Usage
|
||
|
|
|
||
|
|
### Working Commands
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Show version
|
||
|
|
code --version
|
||
|
|
# Output: Cursor WSL Wrapper 1.0.0
|
||
|
|
|
||
|
|
# Show help
|
||
|
|
code --help
|
||
|
|
|
||
|
|
# Attempt to open (shows path if auto-open fails)
|
||
|
|
code .
|
||
|
|
code /path/to/file
|
||
|
|
code file1 file2
|
||
|
|
```
|
||
|
|
|
||
|
|
### When Auto-Open Fails
|
||
|
|
|
||
|
|
When you run `code .` or `code <file>`, you'll see:
|
||
|
|
|
||
|
|
```
|
||
|
|
⚠️ Could not open in Cursor automatically.
|
||
|
|
|
||
|
|
File/Directory: /home/intlc/projects/proxmox
|
||
|
|
Windows path: \\wsl.localhost\Ubuntu\home\intlc\projects\proxmox
|
||
|
|
|
||
|
|
Since Cursor is already connected via WSL remote, you can:
|
||
|
|
1. Use Cursor's file explorer (Ctrl+P or File > Open)
|
||
|
|
2. Navigate to: /home/intlc/projects/proxmox
|
||
|
|
3. Or copy this path and paste in Cursor's file dialog
|
||
|
|
```
|
||
|
|
|
||
|
|
**Solution:** Use Cursor's built-in file explorer:
|
||
|
|
- Press `Ctrl+P` (Quick Open)
|
||
|
|
- Or `File > Open Folder`
|
||
|
|
- Navigate to the path shown in the error message
|
||
|
|
|
||
|
|
## Why This Happens
|
||
|
|
|
||
|
|
1. **Cursor is not in Windows PATH** - The `cursor.exe` command is not available from WSL
|
||
|
|
2. **WSL Remote Connection** - Cursor is already connected via WSL remote, which is the primary way to work with files
|
||
|
|
3. **Launcher Patch Failed** - The original launcher patch that would have enabled this failed (non-critical)
|
||
|
|
|
||
|
|
## Workarounds
|
||
|
|
|
||
|
|
### Option 1: Use Cursor's File Explorer (Recommended)
|
||
|
|
Since Cursor is already connected via WSL remote, just use:
|
||
|
|
- `Ctrl+P` for Quick Open
|
||
|
|
- `File > Open Folder` to open directories
|
||
|
|
- File explorer sidebar to navigate
|
||
|
|
|
||
|
|
### Option 2: Add Cursor to Windows PATH
|
||
|
|
If you want the `code` command to work automatically:
|
||
|
|
|
||
|
|
1. Find Cursor installation (usually):
|
||
|
|
- `C:\Program Files\Cursor\Cursor.exe`
|
||
|
|
- `C:\Users\<YourUser>\AppData\Local\Programs\Cursor\Cursor.exe`
|
||
|
|
|
||
|
|
2. Add to Windows PATH:
|
||
|
|
- Windows Settings > System > About > Advanced system settings
|
||
|
|
- Environment Variables > System Variables > Path > Edit
|
||
|
|
- Add Cursor's installation directory
|
||
|
|
|
||
|
|
3. Restart WSL and test:
|
||
|
|
```bash
|
||
|
|
code .
|
||
|
|
```
|
||
|
|
|
||
|
|
### Option 3: Create Windows Shortcut
|
||
|
|
Create a Windows batch file or shortcut that opens Cursor with the WSL path.
|
||
|
|
|
||
|
|
## Conclusion
|
||
|
|
|
||
|
|
The `code` command wrapper is **functional and provides value**:
|
||
|
|
- ✅ Shows correct paths for manual opening
|
||
|
|
- ✅ Provides helpful error messages
|
||
|
|
- ✅ Works with all standard flags
|
||
|
|
- ⚠️ Cannot auto-open (requires Cursor in PATH)
|
||
|
|
|
||
|
|
**Recommendation:** Use Cursor's built-in file explorer (`Ctrl+P`) for the best experience. The wrapper serves as a helpful reference for paths.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Last Updated:** 2025-12-28
|
||
|
|
**Status:** Working as designed, manual file opening required
|
||
|
|
|