aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-03-05 12:34:31 +0000
committerRon Yorston <rmy@pobox.com>2023-03-05 12:43:46 +0000
commit8ade494aebe60ea14026d48025a462e6d0b58a7f (patch)
tree55181219752cf8c2efac037d8f2bd26c71baaca4 /editors/vi.c
parent9aef4d4d298987437e33bf25bcddd16175148d45 (diff)
downloadbusybox-w32-8ade494aebe60ea14026d48025a462e6d0b58a7f.tar.gz
busybox-w32-8ade494aebe60ea14026d48025a462e6d0b58a7f.tar.bz2
busybox-w32-8ade494aebe60ea14026d48025a462e6d0b58a7f.zip
win32: add support for virtual terminal input
Alter certain applets to support virtual terminal input, if enabled. In many places this is achieved by building previously excluded upstream terminal-handling code. The busybox-w32 implementation of termios(3) functions does nothing if virtual terminal input is disabled, so it can be invoked regardless. Some applet-specific terminal-handling code is also required. This affects less, more, vi and command line editing in the shell. (The `more` applet isn't enabled in the default configuration.) This series of patches adds about 1.7KB to the binaries.
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 13f0ae8ee..74028e2b4 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -456,9 +456,7 @@ struct globals {
456#if ENABLE_FEATURE_VI_USE_SIGNALS 456#if ENABLE_FEATURE_VI_USE_SIGNALS
457 sigjmp_buf restart; // int_handler() jumps to location remembered here 457 sigjmp_buf restart; // int_handler() jumps to location remembered here
458#endif 458#endif
459#if !ENABLE_PLATFORM_MINGW32
460 struct termios term_orig; // remember what the cooked mode was 459 struct termios term_orig; // remember what the cooked mode was
461#endif
462 int cindex; // saved character index for up/down motion 460 int cindex; // saved character index for up/down motion
463 smallint keep_index; // retain saved character index 461 smallint keep_index; // retain saved character index
464#if ENABLE_FEATURE_VI_COLON 462#if ENABLE_FEATURE_VI_COLON
@@ -700,7 +698,6 @@ static int mysleep(int hund)
700} 698}
701 699
702//----- Set terminal attributes -------------------------------- 700//----- Set terminal attributes --------------------------------
703#if !ENABLE_PLATFORM_MINGW32
704static void rawmode(void) 701static void rawmode(void)
705{ 702{
706 // no TERMIOS_CLEAR_ISIG: leave ISIG on - allow signals 703 // no TERMIOS_CLEAR_ISIG: leave ISIG on - allow signals
@@ -712,10 +709,6 @@ static void cookmode(void)
712 fflush_all(); 709 fflush_all();
713 tcsetattr_stdin_TCSANOW(&term_orig); 710 tcsetattr_stdin_TCSANOW(&term_orig);
714} 711}
715#else
716#define rawmode() ((void)0)
717#define cookmode fflush_all
718#endif
719 712
720//----- Terminal Drawing --------------------------------------- 713//----- Terminal Drawing ---------------------------------------
721// The terminal is made up of 'rows' line of 'columns' columns. 714// The terminal is made up of 'rows' line of 'columns' columns.