I’m using my own editor as my Git core.editor that I often have open and running already. When I use it to edit a commit message, for example after
git commit # no message specified
the default message is opened into my editor correctly, as COMMIT_MSG, but the commit proceeds aborts before I’ve done anything in the editor. Similarly, an automatic merge opens MERGE_MSG, but the merge completes with the default message before I’ve had a chance to edit it.
Can I use an editor that is already running to edit commit messages in this way? Does the Git invocation of the message editor require a new instance in order to respond to my edits?
gitwaits for the invoked program to exit (with a clean exit status) and then continues. In your case the editor directly exits (and shows the content in the already existing window), which is not whatgitexpects.To solve the problem you need your editor to exit only when you finished editing the file provided by git (which, most likely, means to turn off attaching to an already existing instance).