Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable autoreset of colour in terminal #6076

Open
MetRonnie opened this issue Apr 22, 2024 · 0 comments
Open

Re-enable autoreset of colour in terminal #6076

MetRonnie opened this issue Apr 22, 2024 · 0 comments

Comments

@MetRonnie
Copy link
Member

MetRonnie commented Apr 22, 2024

Problem

The scheduler log would get a spurious color reset char (ESC[0m) at the start of the "DONE" line when not in no-detach mode.

This was being caused by autoreset=True being passed to

# configure Cylc to use colour
color_init(autoreset=True, strip=not use_color)

and some weird interaction with the scheduler daemonization process. The "DONE" line in the log is the only line logged by scheduler_cli after the scheduler has finished running:

LOG.info("DONE")
close_log(LOG)
sys.exit(ret)

Proposed Solution

Note

autoreset was set to False in:

Ideally we want autoreset to be set to True to ensure we don't permanently colour the terminal output by mistake. This will take some figuring out to achieve without getting the spurious reset character again.

I expect with more careful file handing around the daemonization it wouldn't happen (it shouldn't logically), e.g. close logs in the original process and re-open them in the fork?

#6021 (comment)

@MetRonnie MetRonnie added this to the some-day milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant