Skip to content

Potential for ANSI colours to remain active #488

@d7919

Description

@d7919

In _step of logger, the colour remains active after the line is displayed, i.e. it is not reset.

return "| " + " | ".join([colour + cells[i] for i in range(len(cells))]) + " |"

If the user's function has any output or if the system displays any output this will inherit the colour of the last output. This can also potentially cause issues if the user kills the job mid-run leaving the colour code active.

Changing this line to

return "| " + " | ".join([colour + cells[i] + Fore.RESET for i in range(len(cells))]) + " |" 

is perhaps a bit "safer" and has the minor advantage of not colouring the | column separators.

On a side note, it would be helpful if the user could:

  1. Turn off the colouring (if capturing output the escape codes can enter the log file).
  2. Choose the two colours in use -- for me the default Black is unreadable due to the colour of my terminal background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions