feat: add editor config option to editor_command() - #6897
Open
Mo200227 wants to merge 6 commits into
Open
Conversation
Author
|
Fixes #6641 |
semohr
reviewed
Aug 1, 2026
| ~~~~~~ | ||
|
|
||
| The text editor to use when editing configuration files (e.g., via beet config | ||
| -e). Overrides the $VISUAL and $EDITOR environment variables. If none of these |
Contributor
There was a problem hiding this comment.
Please put code markers around the inline variables and command.
I.e.
Overrides the ``$VISUAL`` and ``$EDITOR`` environment variables. If none of these
``beet config -e``
semohr
reviewed
Aug 1, 2026
| monkeypatch.setattr("beets.util.os.altsep", "\\") | ||
| def test_editor_command_falls_back_to_visual(self): | ||
| """Falls back to $VISUAL when no editor config is set.""" | ||
| with patch.dict(os.environ, {"VISUAL": "vim"}, clear=True): |
Contributor
There was a problem hiding this comment.
Suggested change
| with patch.dict(os.environ, {"VISUAL": "vim"}, clear=True): | |
| with patch.dict(os.environ, {"VISUAL": "vim", "EDITOR": "emacs"}, clear=True): |
Contributor
|
Last round of reviews. Again please rebase onto the current master. We need all CI/CD workflows to pass before we can consider merging this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6641
Adds an
editorconfig option so users can permanently set their preferred editor inconfig.yaml, overriding$VISUALand$EDITORenvironment variables which may not be available in virtualenv environments (e.g. pipx with uv backend).Usage:
Changes:
beets/util/__init__.py—editor_command()now checksconfig["editor"]first before falling back to$VISUAL/$EDITORdocs/changelog.rstdocs/reference/config.rsttest/test_util.py@semohr — reopening here as a clean PR per your feedback. All previous review points addressed.