You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for brev open code/cursor commands and default editor setting (#238)
* Add support for brev open code/cursor commands and default editor setting
- Add cursor utilities in pkg/util/util.go with TryRunCursorCommand, InstallCursorExtension, etc.
- Add personal settings management in pkg/files/files.go for storing default editor preference
- Update open command to support 'brev open <workspace> <editor>' syntax
- Add --set-default flag to configure default editor (code or cursor)
- Remove broken --cursor flag in favor of argument-based approach
- Maintain backward compatibility with existing 'brev open <workspace>' usage
- Add proper error handling for invalid editor types and missing executables
Co-Authored-By: Alec Fong <[email protected]>
* Fix lint issues: remove unused store parameters
- Remove unused store parameter from handleSetDefault function
- Remove unused store parameter from determineEditorType function
- Update function calls to match new signatures
Co-Authored-By: Alec Fong <[email protected]>
* Fix argument validation for --set-default flag
- Replace static cobra.RangeArgs(1, 2) with custom validation function
- Allow 0 arguments when --set-default flag is provided
- Maintain 1-2 argument requirement for normal workspace operations
- Resolves issue where 'brev open --set-default cursor' failed with arg validation error
Co-Authored-By: Alec Fong <[email protected]>
* Fix printf formatting in success message for --set-default
- Change t.Vprintf to t.Printf to fix format string mismatch
- Resolves malformed success message '%!!(string=cursor)s(MISSING)'
- Success message now displays correctly as 'Default editor set to cursor'
Co-Authored-By: Alec Fong <[email protected]>
* Fix Terminal method call - use t.Vprint instead of t.Printf
- Terminal type doesn't have Printf method, only Print/Vprint/Vprintf
- Use t.Vprint with string concatenation following codebase patterns
- Resolves build error: 't.Printf undefined'
Co-Authored-By: Alec Fong <[email protected]>
* Fix gofumpt formatting issues - remove extra blank lines
- Remove extra blank lines on lines 80 and 85 that violated gofumpt formatting rules
- Resolves CI lint failure in 'ci (ubuntu-22.04)' check
- All formatting now complies with gofumpt standards
Co-Authored-By: Alec Fong <[email protected]>
* Apply gofumpt formatting to fix remaining lint issues
- Run gofumpt on pkg/cmd/open/open.go to fix all formatting violations
- Remove trailing spaces and fix indentation issues
- Resolves remaining CI lint failure in 'ci (ubuntu-22.04)' check
Co-Authored-By: Alec Fong <[email protected]>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Alec Fong <[email protected]>
ifstrings.Contains(err.Error(), `"code": executable file not found in $PATH`) {
138
206
errMsg:="code\": executable file not found in $PATH\n\nadd 'code' to your $PATH to open VS Code from the terminal\n\texport PATH=\"/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH\""
ifstrings.Contains(err.Error(), "you are in a remote brev instance;") {
290
404
returnbreverrors.WrapAndTrace(err)
291
405
}
292
-
returnbreverrors.WrapAndTrace(fmt.Errorf(t.Red("couldn't open VSCode, try adding it to PATH (you can do this in VSCode by running CMD-SHIFT-P and typing 'install code in path')\n")))
406
+
editorName:="VSCode"
407
+
ifeditorType==EditorCursor {
408
+
editorName="Cursor"
409
+
}
410
+
returnbreverrors.WrapAndTrace(fmt.Errorf(t.Red("couldn't open %s, try adding it to PATH\n"), editorName))
0 commit comments