summaryrefslogtreecommitdiffstats
path: root/adb/commandline.cpp
diff options
context:
space:
mode:
authorSpencer Low <CompareAndSwap@gmail.com>2015-03-01 15:06:21 -0800
committerSpencer Low <CompareAndSwap@gmail.com>2015-03-26 12:26:08 -0700
commit50184062b87a121458fff7d8bda6656c59c71c77 (patch)
tree41145c04cd7fd6cd5ef5f9295f31d4663d9fb801 /adb/commandline.cpp
parentec57440878476149468a014bd41acef27ceb8789 (diff)
downloadsystem_core-50184062b87a121458fff7d8bda6656c59c71c77.zip
system_core-50184062b87a121458fff7d8bda6656c59c71c77.tar.gz
system_core-50184062b87a121458fff7d8bda6656c59c71c77.tar.bz2
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>
Diffstat (limited to 'adb/commandline.cpp')
-rw-r--r--adb/commandline.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index c9b1eab..3330baa 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -245,13 +245,10 @@ int usage()
#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