summaryrefslogtreecommitdiffstats
path: root/adb/shell_service.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-11-03 11:18:40 -0800
committerElliott Hughes <enh@google.com>2015-11-04 10:45:11 -0800
commitc15b17f1acfcdbda8602ab135371f7b7238b4b39 (patch)
treef834ba9f8d7732d1f289a17790cebbc047ce3b9a /adb/shell_service.cpp
parent19d9454ee3c2c3c11272ec34cee0e263a621fd98 (diff)
downloadsystem_core-c15b17f1acfcdbda8602ab135371f7b7238b4b39.tar.gz
system_core-c15b17f1acfcdbda8602ab135371f7b7238b4b39.tar.bz2
system_core-c15b17f1acfcdbda8602ab135371f7b7238b4b39.zip
adb shell SIGWINCH support.
Bug: http://b/19734542 Change-Id: Ic9404a132cb9c42cb6a378bcd4b3dea9188d0a44
Diffstat (limited to 'adb/shell_service.cpp')
-rw-r--r--adb/shell_service.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/adb/shell_service.cpp b/adb/shell_service.cpp
index be5921d8e..e3fde2691 100644
--- a/adb/shell_service.cpp
+++ b/adb/shell_service.cpp
@@ -513,6 +513,18 @@ ScopedFd* Subprocess::PassInput() {
if (stdinout_sfd_.valid()) {
switch (input_->id()) {
+ case ShellProtocol::kIdWindowSizeChange:
+ int rows, cols, x_pixels, y_pixels;
+ if (sscanf(input_->data(), "%dx%d,%dx%d",
+ &rows, &cols, &x_pixels, &y_pixels) == 4) {
+ winsize ws;
+ ws.ws_row = rows;
+ ws.ws_col = cols;
+ ws.ws_xpixel = x_pixels;
+ ws.ws_ypixel = y_pixels;
+ ioctl(stdinout_sfd_.fd(), TIOCSWINSZ, &ws);
+ }
+ break;
case ShellProtocol::kIdStdin:
input_bytes_left_ = input_->data_length();
break;
@@ -531,8 +543,7 @@ ScopedFd* Subprocess::PassInput() {
// non-interactively which is rare and unsupported.
// If necessary, the client can manually close the shell
// with `exit` or by killing the adb client process.
- D("can't close input for PTY FD %d",
- stdinout_sfd_.fd());
+ D("can't close input for PTY FD %d", stdinout_sfd_.fd());
}
break;
}