Skip to content

Open in cursor opens two editor tabs corresponding to line and column #849

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

Open
Thooto opened this issue Apr 10, 2025 · 1 comment
Open

Comments

@Thooto
Copy link

Thooto commented Apr 10, 2025

Hello,

I am using the vite plugin for the devtools and have properly setup launchEditor: "cursor" and added cursor to my path on macos.

When I click a component from the devtools to open it into cursor, it always opens two editors for the line and column of the corresponding html tag:

Image

Apparently cursor requires the --goto option with :line:column appended to the file name to properly go to a line/column:
cursor --goto /.../SomeVueFile.vue:22:1

If anyone else has an issue with this, here is a workaround:

  1. Create a cursorgoto.sh file in your project root with this content:
#!/bin/bash
cursor --goto "$1:$2:$3"
  1. Make it executable chmod +x cursorgoto.sh

  2. Replace it in your vite config:

export default defineConfig({
    plugins: [
        vueDevtools({ launchEditor: './cursorgoto.sh' }),
    ]
});

Thank you!

@Thooto Thooto changed the title Open in cursor opens two editor tabs correspond to line and column Open in cursor opens two editor tabs corresponding to line and column Apr 10, 2025
@glm9412
Copy link

glm9412 commented Apr 30, 2025

Hope the authorities can solve this problem! Let developers not need additional configuration!

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

No branches or pull requests

2 participants