Skip to content

Add the ability to select editors on a per-repository basis#21297

Closed
sweezyio wants to merge 3 commits intodesktop:developmentfrom
sweezyio:development
Closed

Add the ability to select editors on a per-repository basis#21297
sweezyio wants to merge 3 commits intodesktop:developmentfrom
sweezyio:development

Conversation

@sweezyio
Copy link
Contributor

Closes #12195

Description

Adds support for selecting editors on a per-repository basis that are different from the globally selected one.

Changes:

  • Updated the workflow-preferences.ts model to support storing a per-repository override of the globally selected external editor
  • Updated the open-in-external-editor logic to support passing the current repository to allow for retrieval of per-repository overrides (and updated things that depended on this logic where necessary to accomplish the goal of this PR)
Screenshots external editor example

Release notes

Notes: Added per-repository external editor preferences in Repository Settings

Questions:

  • Currently this does not support custom editors and having a custom editor set overrides any per-repository selections. Is this something that I should handle? If so, how? Should I allow for the setting of custom editors on a per-repository basis?
  • From this point, it seems like it would be pretty straightforward to add the same feature but for shells as well. Is that something I should tack onto this PR?

Updated AppStore, Dispatcher, and App components to pass the current repository when opening files or repositories in an external editor
@github-actions github-actions bot added external Pull request originating outside of the Desktop core team triage For incoming issues labels Nov 23, 2025
@niik
Copy link
Member

niik commented Nov 28, 2025

Hey @sweezyio. Thanks for wanting to contribute. I want to set some clear expectations here. We currently have very limited capacity to review and accept PRs for features, especially ones we haven't made a clear decision on how to address. Getting this reviewed thoroughly could end up taking a long time.

A very high level comment on this though is that WorkflowPreferences feels like the wrong place to host this. Workflow preferences is specifically about how the user wants to contribute to the repository (i.e. as an independent fork vs contributing to upstream).

I reckon there's two possible approaches here. Either extend IDatabaseRepository such that we can persist the user's choice there (and forward that to Repository) or we create some type of editor override object that lives separate from repositories. The downside of the latter being that we'd need specific cleanup when a repository gets removed. So, not having thought this through I think I'd prefer the former.

Currently this does not support custom editors and having a custom editor set overrides any per-repository selections. Is this something that I should handle? If so, how? Should I allow for the setting of custom editors on a per-repository basis?

Yes, I imagine users would be confused if we did not offer the ability to use a custom editor in a repository. I imagine this interface would be exactly the same as in the global preferences.

From this point, it seems like it would be pretty straightforward to add the same feature but for shells as well. Is that something I should tack onto this PR?

No. We have not seen the same request for custom shells per repository which makes sense, typically you'd use different editors based on the project but have a global shell. It being straightforward is not a good enough reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Pull request originating outside of the Desktop core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choose the "default editor" per repository.

2 participants