Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

notepad++ requires specific arguments to work nicely with actions like rebase #24

Open
shiftkey opened this issue Sep 4, 2015 · 3 comments

Comments

@shiftkey
Copy link
Member

shiftkey commented Sep 4, 2015

This was raised in git-for-windows/git#278

Notepad++ is triggered 1st time and file opens and Im midway into editing file e.g which commits to squash/reword and before I get a chance to finish in cmd terminal it skips the operation to end. whatever the file I was editing is left as a uncommitted change and has to be discarded or deleted.

The recommended workaround was also identified:

Try setting your editor to "notepad++ -multiInst". Plain notepad++ will only tell the already running instance to open the file before exiting, which looks as if you finished editing the file in record time.

This is because Notepad++ can be used with a tabbed interface, and this can lead to a scenario where a file is opened in a new tab, and then the process closes immediately - getting into a state that's weird and confusing.

I had a quick look at what might be involved with passing arguments to the associated file editor, and I couldn't spot an easy solution. This also requires us to detect you've configured notepad++ as the default editor for text files, which we don't do right now - so that's more work.

I've got a lot on my plate right now, but happy to provide guidance where possible if someone is keen in getting involved.

@un1versal
Copy link

Im unsure if its special argument it requires, I know for sure without setting notepadd++ as a core.editor With or without arguments) it doesn't work at all. GitPad or no and most definitively notepad++ is preset as a default editor for txt files (not just internally but also externally associated to text files in OS side.

So github Desktop which uses GitPad in windows doesn't do cut it, one may even ask what is GitPad doing if at all and why you need it. but there it is.

Notepadd++ You can add more arguments to disable specific options you dont need you can disable tabs, plugins, etc but you definitely need to add it to core.editor else things get terminated prematurely and ends in unclean state.

Looking at https://github.com/github/GitPad I can see that it mentions.

How to uninstall
Remove HKEY_CURRENT_USER\Environment\EDITOR from the registry and reboot your system

however I can assure that no such key exists in my system at all and that Github Desktop where this issue is being tracked from doesnt add this at all or never actually executes GitPad no idea since Github Desktop doenst install like regular software in Windows.

Ive also trying to add progit/progit2#382 but it seems its kind of useless when tickets like this suggest GitPad is to blame what the point of documenting how-tos with GitPad? idk.

Also fixed by - Lesson 6972: Dont use Windows. This problem doesnt exist is sane OS.
I use windows for 5 minutes and spend 8 hours of my life trying to improve and contribute what Im able back to community with his issue...

@shiftkey
Copy link
Member Author

shiftkey commented Sep 7, 2015

So github Desktop which uses GitPad in windows doesn't do cut it, one may even ask what is GitPad doing if at all and why you need it.

This is the first editor-specific issue that's come to my attention with us shelling out to Notepad++. I'd love to understand whether this is a recent issue, or whether this has always been present (and I've just not heard it or encountered it). Do you have any more information on when you first encountered this? Was there a version of Notepad++ that didn't have this issue?

However I can assure that no such key exists in my system at all and that Github Desktop where this issue is being tracked from doesnt add this at all or never actually executes GitPad no idea since Github Desktop doenst install like regular software in Windows.

As per the README, we use the environment variable in GitHub Desktop to assign GitPad to be the default editor:

if your default editor is not set, GitPad.exe will set itself to EDITOR via setting an Environment Variable on your user profile.

Those uninstall instructions sounds like they are out of sync. I've opened #25 to investigate this separately.

I use windows for 5 minutes and spend 8 hours of my life trying to improve and contribute what Im able back to community with his issue...

I'm sorry if you feel frustrated by the lack of progress on this issue. Because GitHub Desktop installs per-user (and has a sandboxed Git environment) we're still going to use GitPad for the moment while I wrap my head around how we can address the original issue (needing to specify arguments to prevent Notepad++ from exiting unexpectedly).

I would love for this to "just work" for Notepad++ and your scenario, but I need to investigate how we can address this properly, rather than abandoning the use of GitPad in GitHub Desktop.

In the meantime, we have the workaround for applying the custom core.editor setting to your ~/.gitconfig to override GitPad.

@un1versal
Copy link

Do you have any more information on when you first encountered this? Was there a version of Notepad++ that didn't have this issue?

This has always happened, it wasn't reported immediately because I dont use windows often, eventually 2 years later had enough and started to look for a solution and chase the issue.

I'm sorry if you feel frustrated by the lack of progress on this issue. Because GitHub Desktop installs per-user (and has a sandboxed Git environment) we're still going to use GitPad for the moment while I wrap my head around how we can address the original issue (needing to specify arguments to prevent Notepad++ from exiting unexpectedly).

Its not the lack of progress,, Ive chased this up and down with everyone, Github support first suggested this was an issue with git when I first reported it, Essentially Im chasing this issue with 3 different projects. one of which is to alleviate the pains by documenting issue and workaround.

In the meantime, we have the workaround for applying the custom core.editor setting to your >~/.gitconfig to override GitPad.

Thank the config gods for that :) Ill sit back and see what happens here since I lack skills to fix this myself.

Thank you in any case.

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

No branches or pull requests

2 participants