dail8859 / dail8859/NotepadNext

🪲 Not possible to correctly use as Editor for Git commands

Open
#678 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.6k
Forks
914
Avg merge
6d 18h
Merged PRs (30d)
7

Description

### Operating System and Version

macOS Sonoma 14.7.1 (23H222)

### Distribution

brew

### Description

I have tried configuring NotepadNext as the Editor for Git commands:

```config
[core]
editor = open -a Notepadnext
```

This doesn't work because:
* The `open` command returns immediately, thus Git cannot wait for user input.
* It looks like there's a bug in NotepadNext which does some weird things with the contents of the file opened and saves those changes, causing Git to act weird when it continues processing the command.

```config
[core]
editor = open -W -a Notepadnext
```

This _kind of_ works:
* The file for user input correctly opens in NotepadNext and the Git command is waiting for the user to finish editing it.
* The file doesn't show any effects of the aforementioned bug. There are no weird automatic changes.

But the problem is:
* If I close the tab with the file used by Git for user input, Git is _still_ waiting for me to finish editing it.
* I have to close and quit NotepadNext entirely to signal to Git that I'm done, so Git will continue its processing.

Is there another way? (The way TextMate does this kind of thing is, it has its own CLI binary which I can configure as the editor: `/usr/local/bin/mate -w` and it signals to Git that I'm done when I close the tab.)

PS: An alternative way to configure editor is to edit your `.zshrc` or `.bashrc` file to add this:
```sh
export EDITOR="open -W -a Notepadnext"
```
But the problems described above will persist.

### Steps to Reproduce

1. Be a Git user.
2. Attempt to configure NotepadNext as editor for Git commands.
3. Try to use a Git command that opens an editor for input. (Commands like `commit` and `rebase` typically do this.)

### Additional Details

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.