mirror of
https://github.com/Eugeny/tabby
synced 2025-01-08 11:19:04 +00:00
fixed #3472
This commit is contained in:
parent
e1980a6611
commit
62b1538462
1 changed files with 9 additions and 8 deletions
|
@ -329,16 +329,17 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||||
throw new Error('Frontend not ready')
|
throw new Error('Frontend not ready')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.store.terminal.detectProgress) {
|
||||||
const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data)
|
const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data)
|
||||||
if (!this.alternateScreenActive && percentageMatch && this.config.store.terminal.detectProgress) {
|
if (!this.alternateScreenActive && percentageMatch) {
|
||||||
const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2])
|
const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2])
|
||||||
if (percentage > 0 && percentage <= 100) {
|
if (percentage > 0 && percentage <= 100) {
|
||||||
this.setProgress(percentage)
|
this.setProgress(percentage)
|
||||||
// this.logger.debug('Detected progress:', percentage)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setProgress(null)
|
this.setProgress(null)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.frontend.write(data)
|
this.frontend.write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue