mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-05 07:47:25 +00:00
[PR #3263] Fix logger terminal state for colorama #3149
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#3149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3263
Author: @ICOM725
Created: 9/10/2026
Status: 🔄 Open
Base:
main← Head:codex/fix-logger-terminal-state📝 Commits (1)
cc3909bfix: preserve logger terminal state for colorama📊 Changes
3 files changed (+95 additions, -1 deletions)
View changed files
📝
prestartup_script.py(+7 -1)➕
tests/requirements.txt(+2 -0)➕
tests/test_logger_stream.py(+86 -0)📄 Description
Fixes #3259.
ComfyUIManagerLogger now delegates isatty() and closed to the original stdout or stderr. This lets colorama preserve ANSI colors on terminals while continuing to strip them from redirected output.
Thanks to @hwprinz for identifying the stream-state mismatch and providing the initial fix direction. Added tests using the real logger and colorama to cover stdout/stderr, terminal/redirected output, and closed streams.
Validation on Windows:
python -X utf8 -m pytest tests -q(55 passed, 14 server E2E tests skipped),ruff check ., andgit diff --check. The 10 new cases exercise both colorama platform branches and fail on the original code (6 failed, 4 passed). Test dependencies are listed intests/requirements.txt.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.