Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Cursor editor support #3222

Open
Ran350 opened this issue Apr 9, 2024 · 0 comments
Open

Request for Cursor editor support #3222

Ran350 opened this issue Apr 9, 2024 · 0 comments
Labels
bug Something isn't working triage Needs to be looked at

Comments

@Ran350
Copy link

Ran350 commented Apr 9, 2024

Description

GitLens does not appear to officially support Cursor editor at this time.
Cursor is An AI-powered code editor based on VSCode
According to the official Cursor website, it is compatible with many VSCode features, but some GitLens features do not work as expected.

Problem

There was a problem with the behavior of the GitLens: Git rebase command when using the Cursor Editor.
What is expected is to open an "interactive rebase" tab on the Cursor editor, but it actually opens on the VSCode.
Also, it opens a text file based rebase edit tab instead of a GUI.

Cause

I checked the git command executed in the terminal and found that code (VSCode) was specified in the editor option.

/usr/bin/git -C "path/to/repository" -c "core.editor=code --wait --reuse-window" -c "sequence.editor=code --wait --reuse-window" rebase --interactive c59a794bd118b6669a0e172a5e2d51854c446672

Successfully rebased and updated refs/heads/main.

Solution

I ran the git command with core.editor and sequence.editor set to cursor, and it opened the rebase edit tab in the Cursor Editor, as expected.

/usr/bin/git -C "path/to/repository" -c "core.editor=cursor --wait --reuse-window" -c "sequence.editor=cursor --wait --reuse-window" rebase --interactive c59a794bd118b6669a0e172a5e2d51854c446672

To support the Cursor editor, I would expect the following parts of the GitLens source code to be changed.

export function getEditorCommand() {
let editor;
switch (env.appName) {
case 'Visual Studio Code - Insiders':
editor = 'code-insiders --wait --reuse-window';
break;
case 'Visual Studio Code - Exploration':
editor = 'code-exploration --wait --reuse-window';
break;
case 'VSCodium':
editor = 'codium --wait --reuse-window';
break;
default:
editor = 'code --wait --reuse-window';
break;
}
return editor;
}

However, I am concerned that this may complicate the implementation since there is no easy way to determine whether the environment is a Cursor Editor environment or not.

Question

Therefore, I would like to ask you, the maintainer, the following questions,

  • Do you intend to support Cursor, the unofficial VSCode editor, in the first place?
  • If so, what would be the best way to implement it?

Version

GitLens Version: 14.9.0

Cursor editor version

  • version: 0.30.5
  • commit: 1.86.2
  • date: 0e81b24fc275f346a0c44466c7c3cb7152835340
  • Electron: 2024-03-27T00:47:31.099Z
  • ElectronBuildId: 27.2.3
  • Chromium: undefined
  • Node.js: 118.0.5993.159
  • V8: 18.17.1
  • OS: 11.8.172.18-electron.0

Environment

  • Chip: Apple M1
  • macOS: Sonoma 14.3.1
@Ran350 Ran350 added bug Something isn't working triage Needs to be looked at labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs to be looked at
Projects
None yet
Development

No branches or pull requests

1 participant