summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/editors/vi.c b/editors/vi.c
index b56b04b..1e5ef44 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -354,7 +354,7 @@ struct globals {
#if ENABLE_FEATURE_VI_USE_SIGNALS
sigjmp_buf restart; // catch_sig()
#endif
- struct termios term_orig, term_vi; // remember what the cooked mode was
+ struct termios term_orig; // remember what the cooked mode was
#if ENABLE_FEATURE_VI_COLON
char *initial_cmds[3]; // currently 2 entries, NULL terminated
#endif
@@ -462,7 +462,6 @@ struct globals {
#define context_end (G.context_end )
#define restart (G.restart )
#define term_orig (G.term_orig )
-#define term_vi (G.term_vi )
#define initial_cmds (G.initial_cmds )
#define readbuffer (G.readbuffer )
#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
//----- Set terminal attributes --------------------------------
static void rawmode(void)
{
- tcgetattr(0, &term_orig);
- term_vi = term_orig;
- term_vi.c_lflag &= (~ICANON & ~ECHO); // leave ISIG on - allow intr's
- term_vi.c_iflag &= (~IXON & ~ICRNL);
- term_vi.c_oflag &= (~ONLCR);
- term_vi.c_cc[VMIN] = 1;
- term_vi.c_cc[VTIME] = 0;
- erase_char = term_vi.c_cc[VERASE];
- tcsetattr_stdin_TCSANOW(&term_vi);
+ // no TERMIOS_CLEAR_ISIG: leave ISIG on - allow signals
+ set_termios_to_raw(STDIN_FILENO, &term_orig, TERMIOS_RAW_CRNL);
+ erase_char = term_orig.c_cc[VERASE];
}
static void cookmode(void)