Skip to content

armgit / xtool

Public Imported from GitHub
0

Cross-platform Xcode replacement. Build and deploy iOS apps with SwiftPM on Linux, Windows, macOS.

fix: strip trailing carriage return in console prompt on crlf terminals (#328)

Bit Wolfb50173f7b1f7
diff --git a/Sources/XToolSupport/Console.swift b/Sources/XToolSupport/Console.swift
index 8dc420c..ba6136e 100644
--- a/Sources/XToolSupport/Console.swift
+++ b/Sources/XToolSupport/Console.swift
@@ -37,7 +37,8 @@ enum Console {
data += view
}
}
- return String(decoding: data, as: UTF8.self)
+ let str = String(decoding: data, as: UTF8.self)
+ return str.hasSuffix("\r") ? String(str.dropLast()) : str
}
}