Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer: only use SW_HIDE on custom editors that use a wrapper script #303

Merged
merged 1 commit into from
Sep 7, 2020

Conversation

rimrul
Copy link
Member

@rimrul rimrul commented Sep 5, 2020

We're currently assuming that directly called editors ignore our request
to hide their initial window, but some editors honor that request.
This causes the installer to get stuck waiting for user input in a
hidden window.

This fixes git-for-windows/git#2684.

We're currently assuming that directly called editors ignore our request
to hide their initial window, but some editors honor that request.
This causes the installer to get stuck waiting for user input in a
hidden window.

This fixes git-for-windows/git#2684.

Signed-off-by: Matthias Aßhauer <[email protected]>
@@ -1494,7 +1496,13 @@ begin
InputText:='Please modify this text, e.g. delete it, then save it and exit the editor.'
SaveStringToFile(TmpFile,InputText,False);

if not ShellExec('',CustomEditorPath,CustomEditorOptions+' "'+TmpFile+'"','',SW_HIDE,ewWaitUntilTerminated,Res) then begin
CustomEditorExt:=ExtractFileExt(CustomEditorPath);
if (CompareText(CustomEditorExt,'.bat')=0) or (CompareText(CustomEditorExt,'.cmd')=0) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do this for .ps1 scripts, too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Powershell launches them fine even with SW_HIDE. They aren't on PATHEXT by default, though and their default associaton is to open them with notepad.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarifying!

@dscho dscho merged commit cb63927 into git-for-windows:main Sep 7, 2020
dscho added a commit that referenced this pull request Sep 29, 2020
It is [now
possible](#303)
to use `wordpad.exe` as Git's editor of choice.

Signed-off-by: Johannes Schindelin <[email protected]>
@rimrul rimrul deleted the installer-wordpad branch January 9, 2021 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Support Wordpad.exe as an editor choice
2 participants