Skip to content

Commit 58bb41c

Browse files
authored
Merge pull request #294 from compnerd/smart
TSCBasic: enable proper rendering on Windows
2 parents 9a23d5c + 1022d85 commit 58bb41c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/TSCBasic/TerminalController.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,13 @@ public final class TerminalController {
112112

113113
/// Computes the terminal type of the stream.
114114
public static func terminalType(_ stream: LocalFileOutputByteStream) -> TerminalType {
115-
#if os(Windows)
116-
return _isatty(_fileno(stream.filePointer)) == 0 ? .file : .dumb
117-
#else
115+
#if !os(Windows)
118116
if ProcessEnv.vars["TERM"] == "dumb" {
119117
return .dumb
120118
}
119+
#endif
121120
let isTTY = isatty(fileno(stream.filePointer)) != 0
122121
return isTTY ? .tty : .file
123-
#endif
124122
}
125123

126124
/// Tries to get the terminal width first using COLUMNS env variable and

0 commit comments

Comments
 (0)