I configured Sublime Text as my Git commit editor. When I do git commit
Sublime opens and I write the commit message and then I save the file and close it, but in the git terminal it is still stuck in the git commit, and didn't return the console to me!.
How do I return to the console after editing with Sublime?
I think you need -w
.
Try setting Sublime as the editor for git with
git config --global core.editor "subl -w"
This will wait with returning until you actually close the file, which will work better for git.
You may also want to use -n
, which will start a new Sublime window for your commit message so that when you close it, the files you were working on are unaffected (you don't have to close your main editor window):
git config --global core.editor "subl -w -n"
Or on Windows, something like
git config --global core.editor "'c:/program files/sublime text 3/sublime_text.exe' -w -n"
I think it's not possible to do it upon closing the tab in a multi-tab window though, at least not trivially.
I had the same problem after making sublime my editor with -n (new window) -w (wait) options. What worked for me was making sure they are both running with the same privileges i.e. if shell is running elevated then sublime has to be elevated and vice versa if shell isn't elevated then sublime shouldn't be elevated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With