https://pulumi.com logo
#general
Title
# general
b

busy-umbrella-36067

10/02/2018, 10:14 PM
anyone know why circleci wont display ANSI colors for pulumi? 😢
w

white-balloon-205

10/02/2018, 10:27 PM
@bitter-oil-46081 @lemon-spoon-91807 Any idea?
l

lemon-spoon-91807

10/02/2018, 10:28 PM
can you clarify a bit more?
what are you seeing?
For example, are you seeing no colors, but would like them?
are you seeing control codes printed out, but not colorized?
something else entirely?
b

bitter-oil-46081

10/02/2018, 10:32 PM
The issue is probably here: https://github.com/pulumi/pulumi/blob/6e29ada4b8478b8cc0f1fcf57991b131e21987ed/pkg/util/cmdutil/diag.go#L38-L44 I would guess that when run as part of CircleCI, we don't believe we are connected to a terminal and so we don't print the color codes.
b

busy-umbrella-36067

10/02/2018, 10:34 PM
pulumi preview --non-interactive --color always
@lemon-spoon-91807 ^
l

lemon-spoon-91807

10/02/2018, 10:34 PM
Thanks!
since you're seeing this:
that means that pulumi thinks this is not a terminal
which would also explain the lack of colors
b

busy-umbrella-36067

10/02/2018, 10:36 PM
anything that can be done to override that?
im guessing its not just as simple as setting
TERM
env var
l

lemon-spoon-91807

10/02/2018, 10:37 PM
i don't k now enoug about unix+go to know 🙂
i spelunked through the go code, and this bottoms out in stuff that's really beyond me unfortunately. Sorry! Maybe someone else will have an idea.
b

busy-umbrella-36067

10/02/2018, 10:42 PM
setting
--color raw
should ignore it
lets see
lol no it just looks fucked up lol
l

lemon-spoon-91807

10/02/2018, 10:44 PM
yeah, that says to just echo raw colorization codes
and really, that value only exists so we can test things 🙂
b

busy-umbrella-36067

10/02/2018, 10:44 PM
ugh
thought it was gonna be bash color codes
i might compile a custom binary just for this
l

lemon-spoon-91807

10/02/2018, 10:53 PM
is there anything online about how to get circleci to behave more like a terminal?
b

big-piano-35669

10/02/2018, 11:20 PM
@lemon-spoon-91807 Is the issue possibly what Matt pointed out? That we are intentionally switching to
color.Never
, due to
Copy code
if globalColorization == colors.Always && !terminal.IsTerminal(int(os.Stdout.Fd())) {
		return colors.Never
	}
? Not sure, but if so, it seems like if someone explicitly asked for colorization, we should respect it?
b

bitter-oil-46081

10/02/2018, 11:24 PM
IMHO, we should bring back the Auto value for colorization (and have it be the default) and update the above to check colors.Auto instead of Always and just respect Always, Never and Raw.
👍 2
💯 1
g

glamorous-printer-66548

10/04/2018, 3:54 AM
just ran into the same problem on gitlab ci
w

white-balloon-205

10/04/2018, 3:58 AM
l

lemon-spoon-91807

10/04/2018, 9:53 PM
If you now pass
--color=always
, we'll respect that and actually print colors no matter what. Leaving out the command line option, or specifying 'auto' will put us in the mode where we try to figure out what's best in terms or colors or not.
4 Views