From 62b153846287ae6696ef40be8b71693c2b96ac48 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Mon, 15 Mar 2021 08:59:22 +0100 Subject: [PATCH] fixed #3472 --- .../src/api/baseTerminalTab.component.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/terminus-terminal/src/api/baseTerminalTab.component.ts b/terminus-terminal/src/api/baseTerminalTab.component.ts index be18031b..9512bb9a 100644 --- a/terminus-terminal/src/api/baseTerminalTab.component.ts +++ b/terminus-terminal/src/api/baseTerminalTab.component.ts @@ -329,15 +329,16 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit throw new Error('Frontend not ready') } - const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data) - if (!this.alternateScreenActive && percentageMatch && this.config.store.terminal.detectProgress) { - const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2]) - if (percentage > 0 && percentage <= 100) { - this.setProgress(percentage) - // this.logger.debug('Detected progress:', percentage) + if (this.config.store.terminal.detectProgress) { + const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data) + if (!this.alternateScreenActive && percentageMatch) { + const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2]) + if (percentage > 0 && percentage <= 100) { + this.setProgress(percentage) + } + } else { + this.setProgress(null) } - } else { - this.setProgress(null) } this.frontend.write(data) }