mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
report progress from the console commands in tab headers and taskbar
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user