Open ktdq opened 1 week ago
Thanks @ktdq ! Do you have any MWE so that I can test?
Something along these lines:
$ ssh localhost 'julia -e "using PrettyTables; @show(string(PrettyTables._reset_crayon))"' < /dev/null > out 2>&1
$ sleep 5
$ cat out
string(PrettyTables._reset_crayon) = ""
$ julia -e "using PrettyTables; @show(string(PrettyTables._reset_crayon))"
string(PrettyTables._reset_crayon) = "\e[0m"
I use ssh to precompile on a cluster, and there's no terminal...
What is wrong with just hardcoding the string?
const _reset_crayon_str = "\e[0m"
Hum, that will be difficult to reproduce in the CI. Maybe hardcoding the string is the only safe solution then.
Just tried, hardcoding doesn't work when there's no terminal. You really want an empty string in this case otherwise you have extra escape codes in otherwise plain text output.
The only safe way is to remove _reset_crayon_str
completely and let Crayon.jl logic figure out if _reset_crayon
should print anything or not.
Ok, thanks.
const _reset_crayon_str = string(_reset_crayon) is evaluated during precompilation of the package. But when there's no terminal support it becomes an empty string. When loaded afterwards with a proper terminal it fails to draw things correctly.
Need to ensure that the initialization of _reset_crayon_str occurs at runtime rather than at compile time.