[RemoteUtil] Fix output from Windows SSH commands (#90)

Adds an ArchType argument to many RemoteUtil methods, which is used to
replace -tt (forced pseudo-TTY allocation) by -T (no pseudo-TTY
allocation). The -tt option adds tons of ANSI escape sequences to the
output and makes it unparsable, even after removing the sequences, as
some sequences like "delete the last X characters" are not honoured.

An exception is BuildProcessStartInfoForSshPortForward, where
replacing -tt by -T would make the port forwarding process exit
immediately.
This commit is contained in:
Lutz Justen
2023-02-06 18:42:00 +01:00
committed by GitHub
parent 5b82722ec1
commit 24906eb36e
8 changed files with 83 additions and 31 deletions
+1 -1
View File
@@ -280,7 +280,7 @@ absl::StatusOr<std::unordered_set<int>> PortManager::FindAvailableRemotePorts(
SteadyClock* steady_clock) {
std::string remote_command = GetNetstatCommand(arch_type);
ProcessStartInfo start_info =
remote_util->BuildProcessStartInfoForSsh(remote_command);
remote_util->BuildProcessStartInfoForSsh(remote_command, arch_type);
start_info.name = "netstat";
start_info.flags = ProcessFlags::kNoWindow;