Skip to content

Commit e3f7e01

Browse files
committed
Revert "editor: save and reset terminal after calling EDITOR"
This reverts commit 3d411af, blindly opening /dev/tty and calling tcsetattr() seems to be causing problems. cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=577358 cf. https://lore.kernel.org/git/[email protected]/ Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3d411af commit e3f7e01

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

editor.c

-8
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)