Skip to content

Commit 725a6ae

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/build-angular): fix termination of process when using CTRL+C
Closes #19531 (cherry picked from commit a46bad4)
1 parent 567c3ed commit 725a6ae

File tree

1 file changed

+8
-2
lines changed
  • packages/angular_devkit/build_angular/src/utils

1 file changed

+8
-2
lines changed

packages/angular_devkit/build_angular/src/utils/spinner.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ export class Spinner {
1616
enabled = true;
1717

1818
constructor(text?: string) {
19-
this.spinner = ora(text);
19+
this.spinner = ora({
20+
text,
21+
// The below 2 options are needed because otherwise CTRL+C will be delayed
22+
// when the underlying process is sync.
23+
hideCursor: false,
24+
discardStdin: false,
25+
});
2026
}
2127

2228
set text(text: string) {
@@ -37,7 +43,7 @@ export class Spinner {
3743
this.spinner.stop();
3844
}
3945

40-
start(text?: string) {
46+
start(text?: string): void {
4147
if (this.enabled) {
4248
this.spinner.start(text);
4349
}

0 commit comments

Comments
 (0)