Open jnduli opened 3 years ago
Yeah, this is already on my own todo list. The last time I checked there was no easy way to figure out wether you print to the terminal or pipe the output to another file. I know however, that it's possible in JavaScript. So implementing this with a flag would be an unsatisfying solution. 😅
I think I need to investigate a little further, but If anyone knows a way to achieve this, a tip would be highly appreciated 🙃.
Noted. I'll try to do some research on my side and comment if I find something plausible
Here's what I've found so far:
So a possible alternative would be to have a config that is set at run time depending on whether the output is tty or not.
Also adding a terminal option that will force colors if set. For example, if I do ls --color >> file
the file has the colors.
I'm not quite sure if this is a bug or something that needs to be fixed, but I recently piped output of tasklite to a file with
tasklite >> file
The file still contains the color symbols though:
I was able to fix this with a sed command I got, so if this is intended behaviour we can just close the issue (I'm also not sure how this can be fixed from the haskell side :cry: )