Skip to content

Commit 2e2a2be

Browse files
authored
Merge pull request #23 from badsyntax/terminal-colors
Use terminal colors
2 parents 4071c98 + 03b6fcb commit 2e2a2be

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/terminal/Terminal.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ const NL = '\n';
88
const CR = '\r';
99
const nlRegExp = new RegExp(`${NL}([^${CR}]|$)`, 'g');
1010

11+
class TerminalColors {
12+
public static blue = '\u001b[34m';
13+
public static reset = `\u001b[0m`;
14+
}
15+
1116
export class Terminal implements vscode.Pseudoterminal {
1217
private cmdArgs: string[] = [];
13-
private cmdParams: { [key: string]: string } = {};
1418
private cmd: ChildProcessWithoutNullStreams | undefined;
1519

1620
private readonly writeEmitter = new vscode.EventEmitter<string>();
@@ -38,7 +42,11 @@ export class Terminal implements vscode.Pseudoterminal {
3842
public async exec(cwd: string): Promise<string> {
3943
await this.waitForOpen.wait();
4044

41-
this.write(this.cmdArgs.join(' ') + '\n');
45+
this.write(
46+
`${TerminalColors.blue}${this.cmdArgs.join(' ')}${
47+
TerminalColors.reset
48+
}\n`,
49+
);
4250

4351
const { cmd, output } = this.cli.exec(this.cmdArgs, cwd, {
4452
onStdOut: (buffer: string) => {

0 commit comments

Comments
 (0)