If you're using the command line to handle your commits you may want to try exporting your EDITOR.
$ export EDITOR="$(which code) --wait"
You can validate the export
$ echo$EDITOR
/usr/local/bin/code --wait
I prefer vim for editing, however, I do use vscode from time to time. I only ran the following commands above and was able to end up here. Hopefully, this works for you.
Got an idea from Stackoverflow -- I figured out how to edit my environment variables by typing open .bash_profile in the terminal and sure enough, my default didn't have the --wait flag on it. I'm attaching a screenshot for visual people.
Chirag is a software developer living in Sydney, Australia. He mostly works with
.NET but will dabble with new and shiny tech when no one's looking. He's interested in most things software.
You may have already tried this, but does running code --wait directly work. Also try changing the editor setting to code --disable-extensions --wait to see if that helps.
It might be that the editor is crashing for some reason and returning an empty commit message.
Hi there,
Thank you for all the advice. I have looked at all the suggestions, and I have checked my .gitconfig file: editor = atom -w is set correctly, yet I still have the same issue.
If you're using the command line to handle your commits you may want to try exporting your
EDITOR.You can validate the export
I prefer
vimfor editing, however, I do use vscode from time to time. I only ran the following commands above and was able to end up here. Hopefully, this works for you.This didn't work either. I think I may have downloaded something that's interfering...
You can also use the built-in functionality.
Got an idea from Stackoverflow -- I figured out how to edit my environment variables by typing
open .bash_profilein the terminal and sure enough, my default didn't have the--waitflag on it. I'm attaching a screenshot for visual people.Had the same problem using zsh. Same fix, but the file is .zprofile
Thanks for the comment Bryan! We're covering all the bases here! 😃
You may have already tried this, but does running
code --waitdirectly work. Also try changing the editor setting tocode --disable-extensions --waitto see if that helps.It might be that the editor is crashing for some reason and returning an empty commit message.
I tried this out but no luck. Thanks anyway!
This worked for me if anyone else scrolls this far done.
For thoroughness, I use atom so in my .gitconfig it reads
[core]
editor = atom -w
Hi there,
Thank you for all the advice. I have looked at all the suggestions, and I have checked my .gitconfig file: editor = atom -w is set correctly, yet I still have the same issue.
Hey Badran! Can you take a screen shot of your
.gitconfigfile? (Obviously, blur out the sensitive info.) Also what operating system are you on?