aboutsummaryrefslogtreecommitdiff
path: root/libbb/xfuncs.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-03-06 12:25:39 +0000
committerRon Yorston <rmy@pobox.com>2023-03-06 12:25:39 +0000
commitb50470de96320425adbed82129bdb7f7f5263ddb (patch)
tree129ee385d0d9c658eb7f71717372ea496dd604e1 /libbb/xfuncs.c
parent8ade494aebe60ea14026d48025a462e6d0b58a7f (diff)
downloadbusybox-w32-b50470de96320425adbed82129bdb7f7f5263ddb.tar.gz
busybox-w32-b50470de96320425adbed82129bdb7f7f5263ddb.tar.bz2
busybox-w32-b50470de96320425adbed82129bdb7f7f5263ddb.zip
win32: virtual terminal input fixes
- Disable ENABLE_PROCESSED_INPUT in raw mode. Otherwise ^C isn't immediately detected during shell command line editing with virtual terminal input enabled. - Switch read_key()/unix_readkey() to windows_read_key()/read_key(). This allows the shell `read` builtin to use windows_read_key(). Without this change `read` fails when virtual terminal input is enabled.
Diffstat (limited to 'libbb/xfuncs.c')
-rw-r--r--libbb/xfuncs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index bf15f4c75..cbeb24701 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -326,7 +326,8 @@ int FAST_FUNC get_termios_and_make_raw(int fd, struct termios *newterm, struct t
326 *newterm = *oldterm; 326 *newterm = *oldterm;
327 327
328#if ENABLE_PLATFORM_MINGW32 328#if ENABLE_PLATFORM_MINGW32
329 newterm->imode &= ~(ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT); 329 newterm->imode &=
330 ~(ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT);
330#else 331#else
331 /* Turn off buffered input (ICANON) 332 /* Turn off buffered input (ICANON)
332 * Turn off echoing (ECHO) 333 * Turn off echoing (ECHO)