report progress from the console commands in tab headers and taskbar

This commit is contained in:
Eugene Pankov
2018-08-25 00:22:43 +02:00
parent c9dde2e29c
commit 64f670bd86
7 changed files with 44 additions and 1 deletions

View File

@@ -294,6 +294,14 @@ export class TerminalTabComponent extends BaseTabComponent {
}
write (data: string) {
let percentageMatch = /(\d+(\.\d+)?)%/.exec(data)
if (percentageMatch) {
let percentage = percentageMatch[2] ? parseFloat(percentageMatch[1]) : parseInt(percentageMatch[1])
this.setProgress(percentage)
console.log('Detected progress:', percentage)
} else {
this.setProgress(null)
}
this.termContainer.write(data)
}