--no-mascot does not suppress mascot when run from a TTY
dingo version: 0.14.0
description
The --no-mascot flag has no effect when dingo is invoked from an interactive
terminal (e.g. from a just / make recipe that inherits the TTY). The mascot animation plays regardless of the flag.
reproduce
# in a normal interactive terminal (stdout is a TTY):
dingo go --no-mascot -o /tmp/out.go ./somefile.dingo
# mascot still appears
The flag works only when stdout is not a TTY (pipe, CI, etc.) — but in that case
isTerminal() returns false and opts.NoMascot is already forced to true at
compile.go:146, so the flag is redundant there.
root cause (from source)
parseCompileArgs sets opts.NoMascot = true when it sees --no-mascot
(compile.go:721). That happens at compile.go:131, before the TTY check at
compile.go:146. The TTY check only ever sets NoMascot = true; it never resets
it to false. So the logic looks correct on paper.
In practice, when dingo is launched with a TTY, the animated mascot / spinner
appears before the flag has any observable effect — likely because the UI is
started by a separate goroutine or a wrapper layer that checks isTerminal()
independently and does not consult opts.NoMascot in time.
The flag being consumed at compile.go:721 (inside parseCompileArgs) and the
UI creation at compile.go:171 (buildUI = ui.NewSimpleBuildUI()) appear to be
on the same code path, but the animated output in a TTY context suggests either:
- a top-level welcome/spinner is launched before
parseCompileArgs returns, or
buildUI.Start() at line 172 is reached before opts.NoMascot is evaluated.
workaround
Pipe output through cat to force non-TTY mode:
dingo go --no-mascot ./... | cat
Or set CI=true / redirect stdout to a file if coloured output is not needed.
expected behaviour
dingo go --no-mascot ... should suppress the mascot unconditionally, whether or
not stdout is a TTY.
stretch goal
I would rather be able to permanently disable the mascot as it wastes a lot of realestate, is distracting and gets old, fast. It's cute at first but it ought to have a banner like "to hide mascot run: dingo cfg disable-mascot".
--no-mascotdoes not suppress mascot when run from a TTYdingo version: 0.14.0
description
The
--no-mascotflag has no effect when dingo is invoked from an interactiveterminal (e.g. from a
just/makerecipe that inherits the TTY). The mascot animation plays regardless of the flag.reproduce
The flag works only when stdout is not a TTY (pipe, CI, etc.) — but in that case
isTerminal()returns false andopts.NoMascotis already forced totrueatcompile.go:146, so the flag is redundant there.root cause (from source)
parseCompileArgssetsopts.NoMascot = truewhen it sees--no-mascot(
compile.go:721). That happens atcompile.go:131, before the TTY check atcompile.go:146. The TTY check only ever setsNoMascot = true; it never resetsit to
false. So the logic looks correct on paper.In practice, when dingo is launched with a TTY, the animated mascot / spinner
appears before the flag has any observable effect — likely because the UI is
started by a separate goroutine or a wrapper layer that checks
isTerminal()independently and does not consult
opts.NoMascotin time.The flag being consumed at
compile.go:721(insideparseCompileArgs) and theUI creation at
compile.go:171(buildUI = ui.NewSimpleBuildUI()) appear to beon the same code path, but the animated output in a TTY context suggests either:
parseCompileArgsreturns, orbuildUI.Start()at line 172 is reached beforeopts.NoMascotis evaluated.workaround
Pipe output through
catto force non-TTY mode:dingo go --no-mascot ./... | catOr set
CI=true/ redirect stdout to a file if coloured output is not needed.expected behaviour
dingo go --no-mascot ...should suppress the mascot unconditionally, whether ornot stdout is a TTY.
stretch goal
I would rather be able to permanently disable the mascot as it wastes a lot of realestate, is distracting and gets old, fast. It's cute at first but it ought to have a banner like "to hide mascot run: dingo cfg disable-mascot".