Skip to content

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

Open
@Thooto

Description

@Thooto

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions