Use terminal editor for Edit Collection action #263
Merged
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.
Description
Describe the change. If there is an associated issue, please include the issue link (e.g. "Closes #xxx"). For UI changes, please also include screenshots.
Instead of using the default system editor for
.yml
files when launching the Edit Collection action, we now defer to the$VISUAL
/$EDITOR
env vars. This means we will probably open a text-based editor like vim, where previously it was likely a GUI editor like VSCode. This could potentially be annoying but I think in most cases will be more convenient for users. If we get complaints we can make it configurable.This also includes a new utility
EnvGuard
, which should be used in tests that access environment variables. Since the process environment is global mutable state, tests that access and modify it can fight with each other. This mutex ensures the tests each take their turn. It also makes it easy for them to clean up after themselves.Closes #262
Known Risks
What issues could potentially go wrong with this change? Is it a breaking change? What have you done to mitigate any potential risks?
This is a change in functionality that could potentially break someone's workflow. In general I think it will be an improvement but it could be annoying for some users.
QA
How did you test this?
Manual testing in TUI, added some unit tests
Checklist
CONTRIBUTING.md
already?CHANGELOG.md
?