Potential fixes to progress bar. Better handling of punctuation while reading.

This commit is contained in:
Storm Dragon
2025-06-10 18:10:08 -04:00
parent b0ac6e1409
commit 83cb330d34
12 changed files with 49 additions and 22 deletions

View File

@ -23,8 +23,11 @@ class command():
# Only run if progress monitoring is enabled
try:
if 'progressMonitoring' in self.env['commandBuffer'] and self.env['commandBuffer']['progressMonitoring']:
# Check if current line is a prompt - if so, reset progress state
if self.isCurrentLinePrompt():
self.resetProgressState()
# Only check new incoming text (newDelta), but filter out screen changes
if self.env['screen']['newDelta'] and self.isRealProgressUpdate():
elif self.env['screen']['newDelta'] and self.isRealProgressUpdate():
self.detectProgress(self.env['screen']['newDelta'])
except Exception as e:
# Silently ignore errors to avoid disrupting normal operation
@ -54,6 +57,12 @@ class command():
return False
return True
def resetProgressState(self):
"""Reset progress state when a prompt is detected, allowing new progress operations to start fresh"""
self.env['runtime']['debug'].writeDebugOut("Resetting progress state due to prompt detection", debug.debugLevel.INFO)
self.env['commandBuffer']['lastProgressValue'] = -1
self.env['commandBuffer']['lastProgressTime'] = 0
def detectProgress(self, text):
import re