Skip to content

feat(editor): add system editor option from VISUAL/EDITOR#1102

Open
binbandit wants to merge 1 commit intopingdotgg:mainfrom
binbandit:fix/issue-1068-system-editor-env
Open

feat(editor): add system editor option from VISUAL/EDITOR#1102
binbandit wants to merge 1 commit intopingdotgg:mainfrom
binbandit:fix/issue-1068-system-editor-env

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 15, 2026

Summary

  • add a System Editor picker option backed by VISUAL/EDITOR
  • preserve quoted executable paths and known-editor --goto behavior for env-based launches
  • pass VISUAL and EDITOR through Turbo so the server actually sees them in dev/start flows

Why

Issue #1068 asks for one extra editor option sourced from standard shell editor env vars instead of hardcoding more editors one by one.

The implementation also needs to account for this repo's Turbo setup: without forwarding VISUAL/EDITOR, the feature can pass unit tests while failing in real bun run dev / start flows because the server process never receives those env vars.

Changes

  • add a shared system-editor id so the existing picker and IPC flow can expose one extra editor choice without widening the protocol shape
  • resolve VISUAL first, then EDITOR, parsing quoted commands and flags without breaking executable paths that include spaces
  • reuse known editor launch behavior when the env command resolves to VS Code or Cursor, so --goto still works for line/column targets
  • only surface system-editor when the resolved command is actually available
  • add the picker entry in the web UI
  • forward VISUAL and EDITOR through turbo.json

Validation

  • bun run --cwd apps/server test src/open.test.ts
  • bun fmt
  • bun lint
  • bun typecheck

Closes #1068.

Note

Add 'system-editor' option that resolves the editor from VISUAL/EDITOR environment variables

  • Adds system-editor as a recognized editor id in editor.ts with no fixed command, and surfaces it as a "System Editor" option in the OpenInPicker when available.
  • resolveAvailableEditors in open.ts resolves the system editor command from VISUAL or EDITOR env vars (in that order) and checks availability with isCommandAvailable.
  • On launch, the resolved command is matched against known editors so that --goto line/column behavior is reused when the command maps to a known editor (e.g. code).
  • Quoted executable paths (e.g. Windows paths with spaces) are preserved via a new splitCommandString helper.
  • EDITOR and VISUAL are added to the Turborepo global env passthrough in turbo.json.

Macroscope summarized 00d3085.

@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6919656c-e28b-49da-b587-fc32cbff2bef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support custom code editors via VISUAL/EDITOR environment variables

1 participant