summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-11-18 12:45:48 -0800
committerElliott Hughes <enh@google.com>2015-11-18 12:45:48 -0800
commitc2252df25a9821b95e93b8842042a282574e7c5e (patch)
treef01907582da862724855fabdea9c34398bd0af6e
parent9a6b8eeb44a78064ffbe4c04928a3904b1be2ab3 (diff)
downloadcore-c2252df25a9821b95e93b8842042a282574e7c5e.tar.gz
core-c2252df25a9821b95e93b8842042a282574e7c5e.tar.bz2
core-c2252df25a9821b95e93b8842042a282574e7c5e.zip
Don't send $TERM unless we're talking to a new adbd.
I put the conditional in the wrong place, not realizing that even the old shell system allowed one 'argument'. Bug: http://b/25765657 Change-Id: I2752fb838d6377bf24e5b4cf959462557a196c87
-rw-r--r--adb/commandline.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index c13872a3b..73c8912bd 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -591,14 +591,15 @@ static std::string ShellServiceString(bool use_shell_protocol,
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",