icecream icon indicating copy to clipboard operation
icecream copied to clipboard

color solarization not reset

Open EdLipson5117 opened this issue 3 years ago • 3 comments

I'm using logging in my programs. When testing in vscode's powershell terminal, the solarization is not reset between ic() output and logging output.

Playing around after searching for answers, I found that if I added a print of the reset escape sequence to stderr in colorizedStderrPrint, the solarization was reset. It makes it a lot easier to spot the debugging output among the logging output this way.

def colorizedStderrPrint(s): colored = colorize(s) with supportTerminalColorsInWindows(): stderrPrint(colored) print("\033[0m", file=sys.stderr)

I'm new to git and issues, so I'm not sure what is the proper way to suggest a 'fix' or if it needs a fix at all.

EdLipson5117 avatar Jun 17 '21 11:06 EdLipson5117

I think you're running into #35

alexmojaki avatar Jun 17 '21 11:06 alexmojaki

I thought so too, but that one is closed so I assumed it is different. I fixed it for my purposes. I was looking at how to solve so as to not impact others, leaving icecream as 'working as distributed'

  • added a configuration option
  • move the reset into IceCreamDebugger.call, after the outputFunction call, checking the config setting

The output is effective after the deinit in the supportTerminalColorsInWindows function, but I did not see a neat way to put it there.

EdLipson5117 avatar Jun 17 '21 17:06 EdLipson5117

That issue isn't closed...

alexmojaki avatar Jun 17 '21 18:06 alexmojaki