Skip to content

Commit aa1d04a

Browse files
committed
Use cyan instead of blue for win powershell/command prompt
1 parent 3de5f6e commit aa1d04a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/executeCommandLine/executeCommandLine.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,17 @@ namespace ts {
104104
return `\x1b[1m${str}\x1b[22m`;
105105
}
106106

107+
const isWindows = sys.getEnvironmentVariable("OS") && stringContains(sys.getEnvironmentVariable("OS").toLowerCase(), "windows");
108+
const isWindowsTerminal = sys.getEnvironmentVariable("WT_SESSION");
109+
const isVSCode = sys.getEnvironmentVariable("TERM_PROGRAM") && sys.getEnvironmentVariable("TERM_PROGRAM") === "vscode";
110+
107111
function blue(str: string) {
112+
// Effectively Powershell and Command prompt users use cyan instead
113+
// of blue because the default theme doesn't show blue with enough contrast.
114+
if (isWindows && !isWindowsTerminal && !isVSCode) {
115+
return `\x1b[96m${str}\x1b[39m`;
116+
}
117+
108118
return `\x1b[94m${str}\x1b[39m`;
109119
}
110120

0 commit comments

Comments
 (0)