This commit is contained in:
Eugene Pankov 2021-03-15 08:59:22 +01:00
parent e1980a6611
commit 62b1538462
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4

View file

@ -329,15 +329,16 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
throw new Error('Frontend not ready') throw new Error('Frontend not ready')
} }
const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data) if (this.config.store.terminal.detectProgress) {
if (!this.alternateScreenActive && percentageMatch && this.config.store.terminal.detectProgress) { const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data)
const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2]) if (!this.alternateScreenActive && percentageMatch) {
if (percentage > 0 && percentage <= 100) { const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2])
this.setProgress(percentage) if (percentage > 0 && percentage <= 100) {
// this.logger.debug('Detected progress:', percentage) this.setProgress(percentage)
}
} else {
this.setProgress(null)
} }
} else {
this.setProgress(null)
} }
this.frontend.write(data) this.frontend.write(data)
} }