Merge "Don\'t send screen unless we\'re talking to a new adbd." am: 9f90368701
am: 5e3589da14

* commit '5e3589da14367d34791c146cce87522e7fc3be5a':
  Don't send $TERM unless we're talking to a new adbd.
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index c13872a..73c8912 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -591,14 +591,15 @@
     std::vector<std::string> args;
     if (use_shell_protocol) {
         args.push_back(kShellServiceArgShellProtocol);
+
+        const char* terminal_type = getenv("TERM");
+        if (terminal_type != nullptr) {
+            args.push_back(std::string("TERM=") + terminal_type);
+        }
     }
     if (!type_arg.empty()) {
         args.push_back(type_arg);
     }
-    const char* terminal_type = getenv("TERM");
-    if (terminal_type != nullptr) {
-        args.push_back(std::string("TERM=") + terminal_type);
-    }
 
     // Shell service string can look like: shell[,arg1,arg2,...]:[command].
     return android::base::StringPrintf("shell%s%s:%s",