Skip to content

Pkg doesn't account for env variables in EDITOR #24

@Andarist

Description

@Andarist

const editorOpts = ExternalEditor.splitStringBySpace(editor).map((piece: string) => piece.replace("\\ ", " "));
const bin = editorOpts.shift();

This doesn't account for env variables in the EDITOR variable and people might keep smth like this there:

NVIM_TUI_ENABLE_COLOR=1 nvim

which leads to an attempt to spawn NVIM_TUI_ENABLE_COLOR=1 here:

const editorProcess = spawnSync(
this.editor.bin,

which is, obviously, not correct 😉

I'm not suuuuper sure if it's valid to keep env vars in EDITOR like this but according to my testing at least git handles this OK.

This got initially reported here:
changesets/changesets#498

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