aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/vi.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/editors/vi.c b/editors/vi.c
index b56b04bdd..1e5ef44fb 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -354,7 +354,7 @@ struct globals {
354#if ENABLE_FEATURE_VI_USE_SIGNALS 354#if ENABLE_FEATURE_VI_USE_SIGNALS
355 sigjmp_buf restart; // catch_sig() 355 sigjmp_buf restart; // catch_sig()
356#endif 356#endif
357 struct termios term_orig, term_vi; // remember what the cooked mode was 357 struct termios term_orig; // remember what the cooked mode was
358#if ENABLE_FEATURE_VI_COLON 358#if ENABLE_FEATURE_VI_COLON
359 char *initial_cmds[3]; // currently 2 entries, NULL terminated 359 char *initial_cmds[3]; // currently 2 entries, NULL terminated
360#endif 360#endif
@@ -462,7 +462,6 @@ struct globals {
462#define context_end (G.context_end ) 462#define context_end (G.context_end )
463#define restart (G.restart ) 463#define restart (G.restart )
464#define term_orig (G.term_orig ) 464#define term_orig (G.term_orig )
465#define term_vi (G.term_vi )
466#define initial_cmds (G.initial_cmds ) 465#define initial_cmds (G.initial_cmds )
467#define readbuffer (G.readbuffer ) 466#define readbuffer (G.readbuffer )
468#define scr_out_buf (G.scr_out_buf ) 467#define scr_out_buf (G.scr_out_buf )
@@ -2731,15 +2730,9 @@ static char *swap_context(char *p) // goto new context for '' command make this
2731//----- Set terminal attributes -------------------------------- 2730//----- Set terminal attributes --------------------------------
2732static void rawmode(void) 2731static void rawmode(void)
2733{ 2732{
2734 tcgetattr(0, &term_orig); 2733 // no TERMIOS_CLEAR_ISIG: leave ISIG on - allow signals
2735 term_vi = term_orig; 2734 set_termios_to_raw(STDIN_FILENO, &term_orig, TERMIOS_RAW_CRNL);
2736 term_vi.c_lflag &= (~ICANON & ~ECHO); // leave ISIG on - allow intr's 2735 erase_char = term_orig.c_cc[VERASE];
2737 term_vi.c_iflag &= (~IXON & ~ICRNL);
2738 term_vi.c_oflag &= (~ONLCR);
2739 term_vi.c_cc[VMIN] = 1;
2740 term_vi.c_cc[VTIME] = 0;
2741 erase_char = term_vi.c_cc[VERASE];
2742 tcsetattr_stdin_TCSANOW(&term_vi);
2743} 2736}
2744 2737
2745static void cookmode(void) 2738static void cookmode(void)