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

Suggestion: Support Wordpad.exe as an editor choice #2684

Closed
omatai opened this issue Jun 11, 2020 · 18 comments · Fixed by git-for-windows/build-extra#303
Closed

Suggestion: Support Wordpad.exe as an editor choice #2684

omatai opened this issue Jun 11, 2020 · 18 comments · Fixed by git-for-windows/build-extra#303

Comments

@omatai
Copy link

omatai commented Jun 11, 2020

  • I tried to configure wordpad.exe as an editor during the Git-for-windows install process on Windows 10. It hung. I was forced to kill the install process(es) via Task Manager. Last time I checked, colour does not influence the way any command script runs. So please support at least one editor that operates in plain black and white :-)

Setup

  • 64-bit
$ git --version --build-options

git version 2.27.0.windows.1
cpu: x86_64
built from commit: 907ab1011dce9112700498e034b974ba60f8b407
sizeof-long: 4
sizeof-size_t: 8

  • Windows 10 64-bit
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18363.836]
  • What options did you set as part of the installation? Or did you choose the
    defaults?

Editor was the first option I tried to change. **Answering no further questions - just wanted to execute 1 single git command so I could move forward with a build process that had already taken a ridiculous length of time. No time left to fill in forms... **

# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** insert your machine's response here **
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** insert your response here **

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** insert your response here **

** insert your commands here **
  • What did you expect to occur after running these commands?

** insert here **

  • What actually happened instead?

** insert here **

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

** insert URL here **

@rimrul
Copy link
Member

rimrul commented Jun 12, 2020

support at least one editor that works in plain black and white.

We support notepad, that operates in black on white, vim and nano can probably configured to not output any colour as well (that would be white on black, unless you changed your terminal colours around).

Back to your wordpad request. I know wordpad can be used to edit textfiles (even though it's a colossal pain in the butt for that), but does it handle LF line endings? Does it's process exit when you close the document (and only then)?

@rimrul
Copy link
Member

rimrul commented Jun 15, 2020

Wordpad.exe (on Windows 10) seems to handle LF files fine and return at the proper moment. The issue with the "Test custom editor" button seems to be SW_HIDE.

@dscho
Copy link
Member

dscho commented Jun 15, 2020

The issue with the "Test custom editor" button seems to be SW_HIDE.

So it does not start?

@rimrul
Copy link
Member

rimrul commented Jun 15, 2020

It does start a wordpad.exe process, but doesn't show a window. The proccess seems to wait for user interaction with no way for the user to interact with it.

@dscho
Copy link
Member

dscho commented Jun 17, 2020

But with SW_SHOW, an ugly console window will be shown, no?

@rimrul
Copy link
Member

rimrul commented Jun 17, 2020

I'll run some tests. I can definitely say it doesn't get stuck if I write a small batch wrapper wordpad.bat that just passes %* on to wordpad.exe.

@dscho
Copy link
Member

dscho commented Jun 17, 2020

I'll run some tests. I can definitely say it doesn't get stuckif I write a small batch wrapper wordpad.bat that just passes %* on to wordpad.exe.

Is it possible that a prompt is making it stuck, a prompt that is only "shown" if in SW_HIDE mode? I don't even know how to test this, as redirecting the output to a file might require replacing the ShellExec() by a different function call. Or maybe not?

@rimrul
Copy link
Member

rimrul commented Jun 17, 2020

Ok, I've done some test, SW_SHOW only causes a console window for batch files and console applications.

Custom editors that work with SW_HIDE:

  • Notepad++
  • VS Code (via bin/code.cmd)
  • Excel (passes the test in our setup, even though it's not exactly intended as a text editor)

Custom editors that require SW_SHOW:

  • wordpad.exe
  • Nano
  • VS Code (calling Code.exe directly)
  • notepad.exe skipping our wrapper script

I guess we could pass SW_HIDE when the CustomEditorPath ends with .bat or .cmd and SW_SHOW otherwise.

@dscho
Copy link
Member

dscho commented Jun 18, 2020

I guess we could pass SW_HIDE when the CustomEditorPath ends with .bat or .cmd and SW_SHOW otherwise.

That's a splendid idea!

@omatai how about contributing this suggested change together with support for Wordpad.exe? To get started:

  1. install Git for Windows' SDK,

  2. sdk cd installer,

  3. edit install.iss.

    You will want to adjust this line to make use a flag of type DWORD (I think...) that is set conditionally, as indicated above, probably using WildcardMatch() for the if condition.

    For the second commit, the one adding support for Wordpad.exe, I would recommend imitating git-for-windows/build-extra@7a51b61.

  4. build a new installer via sdk build installer/test the page via ./release.sh -d Editor

  5. verify that that installer works as expected?

  6. open a PR?

@omatai
Copy link
Author

omatai commented Jun 18, 2020

I have zero experience with git, and zero desire to gain any. I'm only here because other products I want force me to use git. I have enough trouble building those products and integrating them, let alone get involved in maintaining products I don't actually want.

I only logged this comment because the first product I didn't want went on to persuade me to download a further product I didn't want, and failed to let me use the product I already had (i.e. Wordpad)

It all feels like the equivalent of being urged to invest in a mechanical excavator when you already have a shovel, and you are only wanting to dig a hole to plant a tree. I'm sure there are tasks out there that warrant a mechanical excavator, but if you look around the world, you'll notice that most people do not perform those tasks, and most people only ever use shovels.

I think a request to support Wordpad.exe (and/or Notepad.exe, but that really sucks as an editor) is reasonable, so I made the request. But I've pushed past all of this an have no further interest in any of it, sorry.

@esaulpaugh
Copy link

testing notepad.exe during install causes the installer to hang unrecoverably

rimrul added a commit to rimrul/build-extra that referenced this issue 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.

Signed-off-by: Matthias Aßhauer <[email protected]>
@rimrul
Copy link
Member

rimrul commented Sep 5, 2020

Unless your notepad.exe is configured for LF eol's, please use the wrapper script /usr/bin/notepad instead of directly calling it.

@esaulpaugh
Copy link

Unless your notepad.exe is configured for LF eol's, please use the wrapper script /usr/bin/notepad instead of directly calling it.

just as soon as the installer starts responding again : )

@omatai
Copy link
Author

omatai commented Sep 24, 2020

OK: this is ridiculous. There are two editors shipped with windows that don't require installation: notepad.exe and wordpad.exe. FFS make at least one of them work!!! This is Git for WINDOWS. Talk of wrapping notepad.exe as /usr/bin/notepad is something from the Linux/Unix world. You may as well be talking Greek. Thanks to a burglary, I am once again reluctantly installing git to access other software. I have tried to install Git For Windows, but will once again give up because there are no editors available that make any kind of sense to me. I'm already downloading git (that I don't actually want) and GfW makes me needlessly download more crap I don't want. Why? Seriously: why? I don't think you appreciate quite how much of a barrier to uptake of GfW you have created, and to what extent it represents shooting yourselves in the foot. Make an easy-to-use product that people like, and you'll get people helping you. Create barriers at the very start, and you'll struggle. You've chosen the latter. Strong advice: reopen the issue and fix it.

@rimrul
Copy link
Member

rimrul commented Sep 25, 2020

OK: this is ridiculous.

Yes, something here is ridiculous. But frankly, that something is you.

There are two editors shipped with windows that don't require installation: notepad.exe and wordpad.exe

Well one of them isn't really a text editor, but more of a word processor.

FFS make at least one of them work!!!

Notepad does work. Via the provided wrapper script. I've also created a similar wrapper script for wordpad and created another PR that adds both notepad and wordpad to the dropdown in the installer. It just needs a little more fine tuning, but both of those changes should be in the next version of Git for Windows.

None of those where exactly large changes and this is an open source project. One of the big principles of open source is: If it bothers you, fix it; if you don't care enough to fix it, don't expect others to. You could and should have fixed this yourself.

This is Git for WINDOWS. Talk of wrapping notepad.exe as /usr/bin/notepad is something from the Linux/Unix world. You may as well be talking Greek

First and foremost this is Git for Windows. And Git is a tool with strong roots in the Unix world. This is like studying greek philosophy and expecting not to see a single greek word.

notepad.exe without a wrapper quite simply doesn't meet the requirements to be an editor for Git prior to a certain version of Windows 10 and we still support Vista. This isn't just Git for Windows 10. Also it still needs user configuration to meet the requirements. wordpad.exe still doesn't.

Thanks to a burglary

I'm sorry to hear about that. I hope you lost no important data. Hardware can be replaced, software reinstalled, but losing weeks of work or family photos just sucks.

I'm already downloading git (that I don't actually want)

That's hardly our fault.

and GfW makes me needlessly download more crap I don't want.

Both nano and vim are shipped with Git for Windows. They both work great as editors for Git. No need to download anything extra. The notepad wrapper script is also included, it just needs some configuration.

I have tried to install Git For Windows, but will once again give up because there are no editors available that make any kind of sense to me. […] I don't think you appreciate quite how much of a barrier to uptake of GfW you have created, and to what extent it represents shooting yourselves in the foot. Make an easy-to-use product that people like, and you'll get people helping you. Create barriers at the very start, and you'll struggle. You've chosen the latter.

With all that I've said above this reads like a long-winded way of saying "I can't figure out how to exit vim.", no, even worse "I can't figure out how to exit nano". (It shows you how, right on the screen).

Creating barriers? We've brought Git to Windows without the need to emulate a full Unix system the whole time. Feel free to use Cygwin Git or WSL Git or even Git in a Linux VM if that's easier for you. But I think Git for Windows has significantly lowered the barrier of entry to use Git on Windows. So maybe, just stop smack talking over a decade of hard work unless you're willing to contribute significant improvements or create a better alternative.

Strong advice: reopen the issue and fix it.

What I'm seeing from you is all talk and no action. Strong advice: Stop demanding others fix your problems for free. Get your act together and solve some of them yourself. We would have been happy to help you help yourself.

@dscho
Copy link
Member

dscho commented Sep 25, 2020

@omatai Please watch your language. Not only will offending the very people who you ask to implement what you desire most likely have a different outcome than what you think (and for good reason: would you want to do something for somebody who just insulted you?), it even more importantly violates our code of conduct. Please be sure to review it before continuing this conversation: https://github.com/git-for-windows/git/blob/main/CODE_OF_CONDUCT.md

@esaulpaugh
Copy link

I have a few suggestions for where y'all might opt to shove that CoC but I'm going to keep them to myself.

If git is born of a culture of freedom then let people use Windows-specific line endings. Their whitespace, their choice?

@git-for-windows git-for-windows locked as resolved and limited conversation to collaborators Sep 25, 2020
@rimrul
Copy link
Member

rimrul commented Sep 25, 2020

Feel free to implement that. Most people have better stuff to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants