adb shell: Win32: fix Ctrl-C, tab completion, line editing, server echo
The 'adb shell' command on Windows has had problems:
* Ctrl-C killed the local Windows adb.exe process instead of sending the
Ctrl-C to the Android device.
* Local echo was enabled, causing everything typed to be displayed twice.
* Line input was enabled, so the Android device only received input
after hitting enter. This meant that tab completion did not work because
the tab wasn't seen by the shell until pressing enter.
* The usual input line editing keys did not work (Ctrl-A to go to the
beginning of the line, etc.).
This commit fixes these issues by reconfiguring the Win32 console and
then translating input into what Gnome Terminal would send, in effect
somewhat emulating a Unix terminal.
This does not fix all Win32 console issues, but is designed to be better
than what we had before, and to make the common day-to-day usage much
more comfortable and usable.
Change-Id: Idb10e0b634e27002804fa99c09a64e7176cf7c09
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
diff --git a/commandline.cpp b/commandline.cpp
index c9b1eab..3330baa 100644
--- a/commandline.cpp
+++ b/commandline.cpp
@@ -245,13 +245,10 @@
#if defined(_WIN32)
-// Windows does not have <termio.h>.
-static void stdin_raw_init(int fd) {
-
-}
-
-static void stdin_raw_restore(int fd) {
-
+// Implemented in sysdeps_win32.c.
+extern "C" {
+void stdin_raw_init(int fd);
+void stdin_raw_restore(int fd);
}
#else