Repository navigation
respect configured editor - #814
Conversation
mislav
left a comment
There was a problem hiding this comment.
I love the simplicity of this change!
One note though: now it's not possible to use any environment variable to override editor for a single invocation of gh anymore. Could we consider supporting an additional environment variable to allow this, perhaps something like GH_EDITOR, and have that variable have precedence over gh config?
$ git config --global core.editor vim
$ git var GIT_EDITOR
vim
$ EDITOR=nano git var GIT_EDITOR
vim
$ GIT_EDITOR=nano git var GIT_EDITOR
nano| EditorName string | ||
| } | ||
|
|
||
| func (e *GhEditor) editorName() string { |
There was a problem hiding this comment.
Nit: the method is called "editor name", but it can contain the full invocation path for the editor plus extra arguments I think. Because of that, I think the "name" part might be a slight misnomer because there is more that it can contain than just a name
Perhaps editorCommand would be a better name?
| // EXTENDED to enable different prompting behavior | ||
| type GhEditor struct { | ||
| *survey.Editor | ||
| EditorName string |
There was a problem hiding this comment.
Ditto: this is called EditorName but can contain the full invocation line which is latter shellsplit. In name it's similar to EditorTemplateData.EditorName, but not in behavior. Therefore I would suggest a different name to help clarify the difference
Especially vscode is heavy in `gh pr create` use cli/cli#814
Especially vscode is heavy in `gh pr create` use cli/cli#814
fixes #308
gh now respects and prioritizes whatever is set with
gh config set editor .... it chooses an editor in this way:gh config?unfortunately adding tests did not make sense as the relevant change is below the level at which we can reasonably test survey code. the surface area is small and i think the risk is low.