torch/trepl

Bad colours management

Atcold opened this issue · 4 comments

setprintlevel(0) removes colours output.
noColors() adds a tab after each line. So setprintlevel(0) has noColors() correct behaviour.

Both functions are bugged.

@soumith, I found the bug. It's the trailing \t here! What can we do?

can you send a PR to fix this?

@soumith, I wouldn't know how to remove the trailing \t, since it is necessary to space multi variables input of print().

# Lua's print()
$ th -e "setprintlevel(0); print('abc')" | cat -A
abc$
# No coloured Torch's print()
$ th -e "noColors(); print('abc')" | cat -A
abc^I$
# Torch's print()
$ th -e "print('abc')" | cat -A
^[[0mabc^[[0m^I$

Any suggestion?

Sweet! 👍