edit: I was in EternalTerminal session, and that was the source of the difference. In a regular ssh, it works.
I need to get commands in a pipe to believe they are in a PTY and emit colorized output.
script -c is known to be a workaround to do so.
But for me, ls --color=auto is colorized, and in script -q -e -c 'ls --color=auto' log; cat log nothing is colorized.
I do have LS_COLORS set.
The same happens with gcc: it's colorized in an interactive shell, but not in script -c.
How do programs in script -c find out that they are not in a tty? Why did it work before and doesn't now?
$ script -V
script from util-linux 2.33.2
$ ls --version
ls (GNU coreutils) 8.31