Skip to content

GIT_EDITOR environment variable isn't checked #939

@injust

Description

@injust

I have this VS Code setting enabled:

Git: Terminal Git Editor
Controls whether to enable VS Code to be the Git editor for Git processes spawned in the integrated terminal.

It sets $GIT_EDITOR to "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/git-editor.sh".

I also have $VISUAL set to micro. So when I use Git inside VS Code, it opens a VS Code editor for the rebase todo. Outside of VS Code, it uses micro.

When I press ! in git-interactive-rebase-tool, it opens micro, even if I'm using Git within VS Code.


From https://git-scm.com/docs/git-var:

GIT_EDITOR
The order of preference is the $GIT_EDITOR environment variable, then core.editor configuration, then $VISUAL, then $EDITOR, and then the default chosen at compile time, which is usually vi.

GIT_SEQUENCE_EDITOR
The order of preference is the $GIT_SEQUENCE_EDITOR environment variable, then sequence.editor configuration, and then the value of git var GIT_EDITOR.


https://github.com/MitMaro/git-interactive-rebase-tool/blob/master/src/config/git_config.rs checks core.editor, $VISUAL, $EDITOR, then defaults to vi. Before all of that, it should check $GIT_EDITOR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions