Skip to content

Conversation

@faysou
Copy link

@faysou faysou commented Jan 11, 2026

Summary

Adds support for selecting the preferred editor (VS Code or Cursor) when opening debug sessions in the Dioxus CLI.

Previously, the CLI always used VS Code (code) for debug sessions. This change introduces a new preferred-editor global setting that allows users to choose between VS Code and Cursor editors.

When debugging, the CLI now uses the configured editor's binary command and URL scheme, enabling users who prefer Cursor to seamlessly debug their Dioxus applications without manually switching editors.

Related to issue #5173

Changes

  • Added SupportedEditor enum to settings.rs with Vscode and Cursor variants.

  • Added preferred_editor field to CliSettings struct to store the user's editor preference.

  • Added PreferredEditor variant to the Setting enum in config.rs to support the dx config set preferred-editor command.

  • Updated open_debugger method in builder.rs to:

    • Read the preferred editor from workspace settings (defaulting to VS Code).

    • Map the editor selection to the appropriate binary command and URL scheme.

    • Use the selected editor's binary and URL scheme when opening debug sessions.

  • Updated telemetry logging in logging.rs to include the PreferredEditor setting.

Usage

Users can set their preferred editor using:

dx config set preferred-editor cursor

Or switch back to VS Code:

dx config set preferred-editor vscode

The setting is stored globally and applies to all debug sessions until changed.

Implementation details

The implementation follows the existing CLI settings pattern used by other settings like always-hot-reload and disable-telemetry.

  • The SupportedEditor enum uses clap::ValueEnum for CLI argument parsing and kebab-case serialization for TOML storage.

  • The default editor is VS Code to maintain backward compatibility.

  • The URL scheme (vscode:// or cursor://) and binary command (code or cursor) are mapped dynamically based on the selected editor.

  • All debug session types (Web, macOS, Windows, Linux, Server, iOS, Android) respect the preferred editor setting.

@faysou faysou requested a review from a team as a code owner January 11, 2026 19:49
@jkelleyrtp jkelleyrtp added the cli Related to the dioxus-cli program label Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the dioxus-cli program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants