From 24dabb14d20d7767b385a7b8ab30e9cc2cf70e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Wed, 24 Nov 2021 23:53:52 -0800 Subject: [PATCH] installer: add editor.rogue configuration if EDITOR=vim selected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proactively activate the rogue.editor configuration option if the user persists on using VIM even after being warned against it, to avoid the possibility of terminal output corruption like the one described in microsoft/terminal#9359. Signed-off-by: Carlo Marcelo Arenas Belón --- installer/install.iss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installer/install.iss b/installer/install.iss index f55ac6132b..3afa7f18b5 100644 --- a/installer/install.iss +++ b/installer/install.iss @@ -1866,7 +1866,7 @@ begin // 2nd choice Top:=TopOfLabels; CbbEditor.Items.Add('Use Vim (the ubiquitous text editor) as Git'+#39+'s default editor'); - CreateItemDescription(EditorPage,'The Vim editor, while powerful, can be hard to use. Its user interface is'+#13+'unintuitive and its key bindings are awkward.'+#13+#13+'Note: Vim is the default editor of Git for Windows only for historical reasons, and'+#13+'it is highly recommended to switch to a modern GUI editor instead.'+#13+#13+'Note: This will leave the '+#39+'core.editor'+#39+' option unset, which will make Git fall back'+#13+'to the '+#39+'EDITOR'+#39+' environment variable. The default editor is Vim - but you'+#13+'may set it to some other editor of your choice.',Top,Left,LblEditor[GE_VIM],False); + CreateItemDescription(EditorPage,'The Vim editor, while powerful, can be hard to use. Its user interface is'+#13+'unintuitive and its key bindings are awkward.'+#13+#13+'Note: Vim is the default editor of Git for Windows only for historical reasons, and'+#13+'it is highly recommended to switch to a modern GUI editor instead.'+#13+#13+'Note: This will leave the '+#39+'core.editor'+#39+' option unset, which will make Git fall back'+#13+'to the '+#39+'EDITOR'+#39+' environment variable. The default editor is Vim - but you'+#13+'may set it to some other editor of your choice.'+#13+#13+'Warning: This will set the '+#39+'editor.rogue'+#39+' experimental option to '+#39+'true'+#39+' to attempt'+#13+'to prevent known problems with Vim when used inside Windows Terminal'+#13+'and that is not compatible with other versions of git',Top,Left,LblEditor[GE_VIM],False); EditorAvailable[GE_VIM]:=True; // 3rd choice @@ -3365,6 +3365,8 @@ begin WizardForm.StatusLabel.Caption:='Configuring default editor'; if (CbbEditor.ItemIndex=GE_Nano) then GitSystemConfigSet('core.editor','nano.exe') + else if (CbbEditor.ItemIndex=GE_VIM) then + GitSystemConfigSet('editor.rogue', 'true') else if ((CbbEditor.ItemIndex=GE_NotepadPlusPlus)) and (NotepadPlusPlusPath<>'') then GitSystemConfigSet('core.editor','"'+NotepadPlusPlusPath+'" -multiInst -notabbar -nosession -noPlugin') else if ((CbbEditor.ItemIndex=GE_VisualStudioCode)) and (VisualStudioCodePath<>'') then begin