Skip to content

Commit

Permalink
Force rich to refresh when closing
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-sadeghi committed May 7, 2024
1 parent e84d488 commit 97db3cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tqdm/rich.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,18 @@ def __init__(self, *args, **kwargs):
def close(self):
if self.disable:
return
self.display() # print 100%, vis #1306
self.display(refresh=True) # print 100%, vis #1306
super().close()
self._prog.__exit__(None, None, None)

def clear(self, *_, **__):
pass

def display(self, *_, **__):
def display(self, refresh=False, *_, **__):
if not hasattr(self, '_prog'):
return
self._prog.update(self._task_id, completed=self.n, description=self.desc)
self._prog.update(self._task_id, completed=self.n, description=self.desc,
refresh=refresh)

def reset(self, total=None):
"""
Expand Down

0 comments on commit 97db3cd

Please sign in to comment.