Skip to content

Commit bd9ef99

Browse files
committed
installer: use double quotes when configuring editors
The single quotes are fine when a *shell script* launches the editor, but not when `git.exe` does. This led to the funny issue where switching to the built-in as default editor triggered this bug, because the built-in simply is not a shell script and therefore cannot handle single quotes when spawning an editor. This fixes git-for-windows/git#2011 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 499b8ec commit bd9ef99

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

installer/install.iss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,29 +2612,29 @@ begin
26122612
if (CbbEditor.ItemIndex=GE_Nano) then
26132613
GitSystemConfigSet('core.editor','nano.exe')
26142614
else if ((CbbEditor.ItemIndex=GE_NotepadPlusPlus)) and (NotepadPlusPlusPath<>'') then
2615-
GitSystemConfigSet('core.editor','"'+#39+NotepadPlusPlusPath+#39+' -multiInst -notabbar -nosession -noPlugin"')
2615+
GitSystemConfigSet('core.editor','"'+NotepadPlusPlusPath+'" -multiInst -notabbar -nosession -noPlugin')
26162616
else if ((CbbEditor.ItemIndex=GE_VisualStudioCode)) and (VisualStudioCodePath<>'') then begin
26172617
if (VisualStudioCodeUserInstallation=False) then
2618-
GitSystemConfigSet('core.editor','"'+#39+VisualStudioCodePath+#39+' --wait"')
2618+
GitSystemConfigSet('core.editor','"'+VisualStudioCodePath+'" --wait')
26192619
else begin
2620-
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "'+#39+VisualStudioCodePath+#39+' --wait"','',SW_HIDE,ewWaitUntilTerminated, i) then
2620+
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "\"'+VisualStudioCodePath+'\" --wait"','',SW_HIDE,ewWaitUntilTerminated, i) then
26212621
LogError('Could not set Visual Studio Code as core.editor in the gitconfig.')
26222622
end
26232623
end else if ((CbbEditor.ItemIndex=GE_VisualStudioCodeInsiders)) and (VisualStudioCodeInsidersPath<>'') then begin
26242624
if (VisualStudioCodeInsidersUserInstallation=False) then
2625-
GitSystemConfigSet('core.editor','"'+#39+VisualStudioCodeInsidersPath+#39+' --wait"')
2625+
GitSystemConfigSet('core.editor','"'+VisualStudioCodeInsidersPath+'" --wait')
26262626
else begin
2627-
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "'+#39+VisualStudioCodeInsidersPath+#39+' --wait"','',SW_HIDE,ewWaitUntilTerminated, i) then
2627+
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "\"'+VisualStudioCodeInsidersPath+'\" --wait"','',SW_HIDE,ewWaitUntilTerminated, i) then
26282628
LogError('Could not set Visual Studio Code Insiders as core.editor in the gitconfig.')
26292629
end
26302630
end else if ((CbbEditor.ItemIndex=GE_SublimeText)) and (SublimeTextPath<>'') then begin
2631-
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "'+#39+SublimeTextPath+#39+' -w"','',SW_HIDE,ewWaitUntilTerminated, i) then
2631+
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "\"'+SublimeTextPath+'\" -w"','',SW_HIDE,ewWaitUntilTerminated, i) then
26322632
LogError('Could not set Sublime Text as core.editor in the gitconfig.');
26332633
end else if ((CbbEditor.ItemIndex=GE_Atom)) and (AtomPath<>'') then begin
2634-
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "'+#39+AtomPath+#39+' --wait"','',SW_HIDE,ewWaitUntilTerminated, i) then
2634+
if not ExecAsOriginalUser(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --global core.editor "\"'+AtomPath+'\" --wait"','',SW_HIDE,ewWaitUntilTerminated, i) then
26352635
LogError('Could not set Atom as core.editor in the gitconfig.');
26362636
end else if ((CbbEditor.ItemIndex=GE_CustomEditor)) and (PathIsValidExecutable(CustomEditorPath)) then
2637-
GitSystemConfigSet('core.editor','"'+#39+CustomEditorPath+#39+' '+CustomEditorOptions+'"');
2637+
GitSystemConfigSet('core.editor','"'+CustomEditorPath+'" '+CustomEditorOptions);
26382638
26392639
{
26402640
Install a scheduled task to try to auto-update Git for Windows

0 commit comments

Comments
 (0)