Skip to content

Commit d62a765

Browse files
committed
Merge branch 'jc/save-restore-terminal-revert' into maint
Regression fix for 2.34 * jc/save-restore-terminal-revert: Revert "editor: save and reset terminal after calling EDITOR"
2 parents eef0a8e + e3f7e01 commit d62a765

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

editor.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "strbuf.h"
44
#include "run-command.h"
55
#include "sigchain.h"
6-
#include "compat/terminal.h"
76

87
#ifndef DEFAULT_EDITOR
98
#define DEFAULT_EDITOR "vi"
@@ -51,8 +50,6 @@ const char *git_sequence_editor(void)
5150
static int launch_specified_editor(const char *editor, const char *path,
5251
struct strbuf *buffer, const char *const *env)
5352
{
54-
int term_fail;
55-
5653
if (!editor)
5754
return error("Terminal is dumb, but EDITOR unset");
5855

@@ -86,19 +83,14 @@ static int launch_specified_editor(const char *editor, const char *path,
8683
p.env = env;
8784
p.use_shell = 1;
8885
p.trace2_child_class = "editor";
89-
term_fail = save_term(1);
9086
if (start_command(&p) < 0) {
91-
if (!term_fail)
92-
restore_term();
9387
strbuf_release(&realpath);
9488
return error("unable to start editor '%s'", editor);
9589
}
9690

9791
sigchain_push(SIGINT, SIG_IGN);
9892
sigchain_push(SIGQUIT, SIG_IGN);
9993
ret = finish_command(&p);
100-
if (!term_fail)
101-
restore_term();
10294
strbuf_release(&realpath);
10395
sig = ret - 128;
10496
sigchain_pop(SIGINT);

0 commit comments

Comments
 (0)