edc / bass

Make Bash utilities usable in Fish shell
MIT License
2.2k stars 70 forks source link

Coloured output is not working #70

Closed IvanEh closed 5 years ago

IvanEh commented 5 years ago

When I run something like bass git status the output is of one colour. I know that the example doesn't demonstrate the use case well but I have some scripts that output some useful information. Is it possible to pass colour codes to standard output so that it's correctly displayed?

Thanks for the tool, it's great in any case

edc commented 5 years ago

You don't need bass to run git status. May I ask why you need to do this?

It might not be easy to fix, because here git will detect whether the output is a terminal and then output colored or plain text. That's why if you run git status | tee /tmp/x you also won't see colored output.

edc commented 5 years ago

See this: https://unix.stackexchange.com/questions/10823/where-do-my-ansi-escape-codes-go-when-i-pipe-to-another-process-can-i-keep-them

edc commented 5 years ago

Found this: https://stackoverflow.com/questions/3515208/can-colorized-output-be-captured-via-shell-redirect and it seemed to work for me:

$ bass script -q /dev/null git status
IvanEh commented 5 years ago

git status is just a simplified example that came to my mind. Thank you for explaining, now it makes sense and it's clear where to look.