diff --git a/builtin/commit.c b/builtin/commit.c index 243c626307c644..d106eed6fda26a 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -36,6 +36,7 @@ #include "help.h" #include "commit-reach.h" #include "commit-graph.h" +#include "compat/terminal.h" static const char * const builtin_commit_usage[] = { N_("git commit [] [--] ..."), @@ -1074,11 +1075,14 @@ static int prepare_to_commit(const char *index_file, const char *prefix, struct strvec env = STRVEC_INIT; strvec_pushf(&env, "GIT_INDEX_FILE=%s", index_file); + push_term(1); if (launch_editor(git_path_commit_editmsg(), NULL, env.v)) { + pop_term(); fprintf(stderr, _("Please supply the message using either -m or -F option.\n")); exit(1); } + pop_term(); strvec_clear(&env); }