From 9b75af378ae8afadd264bd154290973ccbceafc6 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Fri, 25 Nov 2022 09:51:35 +1100 Subject: [PATCH] Ensure install progress msg stays in one line (#12165) --- src/kernels/installer/moduleInstaller.node.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/kernels/installer/moduleInstaller.node.ts b/src/kernels/installer/moduleInstaller.node.ts index c2ef96f191b..0286baf4a47 100644 --- a/src/kernels/installer/moduleInstaller.node.ts +++ b/src/kernels/installer/moduleInstaller.node.ts @@ -113,13 +113,16 @@ export abstract class ModuleInstaller implements IModuleInstaller { }); } let lastStdErr: string | undefined; + const ticker = ['', '.', '..', '...']; + let counter = 0; if (observable) { observable.out.subscribe({ next: (output) => { + const suffix = ticker[counter % 4]; + const trimmedOutput = output.out.trim(); + counter += 1; const message = - output.out.length > 100 - ? `${output.out.substring(0, 50)}...${output.out.substring(output.out.length - 50)}` - : output.out; + trimmedOutput.length > 30 ? `${trimmedOutput.substring(0, 30)}${suffix}` : trimmedOutput; progress.report({ message }); traceInfo(output.out); if (output.source === 'stderr') {