Implement cleanup guard to prevent multiple executions on exit
- Introduced a new cleanup function that ensures terminal and browser sessions are cleaned up only once during application exit. - Updated atexit registration to use the new cleanup function, enhancing resource management and preventing potential issues from multiple cleanup calls. - Modified terminal cleanup messaging to only display when environments are cleaned, improving user feedback.
This commit is contained in:
@@ -1406,7 +1406,8 @@ def cleanup_all_environments():
|
||||
except:
|
||||
pass
|
||||
|
||||
print(f"[Terminal Cleanup] Cleaned {cleaned} environments")
|
||||
if not os.getenv("HERMES_QUIET") and cleaned > 0:
|
||||
print(f"[Terminal Cleanup] Cleaned {cleaned} environments")
|
||||
return cleaned
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user