You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a command with long-running output in a <Static> which we would like our users to be able to pipe into a command like more or less. However ink does not seem to handle piped output / lack of TTY as there are ANSI escapes in the output. You also see re-renders for non-Static elements.
> npm run example examples/static | more
> [email protected] example
> NODE_NO_WARNINGS=1 node --loader ts-node/esm examples/static
Completed tests: 0
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #1
Completed tests: 1
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #2
Completed tests: 2
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #3
Completed tests: 3
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #4
Completed tests: 4
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #5
Completed tests: 5
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #6
Completed tests: 6
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #7
Completed tests: 7
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #8
Completed tests: 8
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #9
Completed tests: 9
ESC[2KESC[1AESC[2KESC[1AESC[2KESC[G✔ Test #10
Completed tests: 10
If you simulate a CI run via environment variable, it actually behaves exactly as I would expect:
> CI=1 npm run example examples/static | more
> [email protected] example
> NODE_NO_WARNINGS=1 node --loader ts-node/esm examples/static
✔ Test #1
✔ Test #2
✔ Test #3
✔ Test #4
✔ Test #5
✔ Test #6
✔ Test #7
✔ Test #8
✔ Test #9
✔ Test #10
Completed tests: 10
Shouldn't ink behave the same way for !process.stdout.isTTY as it would for isInCi? Is support for piping output not a common requirement in ink-based CLIs?
The text was updated successfully, but these errors were encountered:
I'm thinking that all the isInCI behaviors in ink.tsx should be possible to enable or disable with a render option, but would default to on if isInCi || !process.stdout.isTTY.
We have a command with long-running output in a
<Static>
which we would like our users to be able to pipe into a command likemore
orless
. However ink does not seem to handle piped output / lack of TTY as there are ANSI escapes in the output. You also see re-renders for non-Static elements.If you simulate a CI run via environment variable, it actually behaves exactly as I would expect:
Shouldn't ink behave the same way for
!process.stdout.isTTY
as it would forisInCi
? Is support for piping output not a common requirement in ink-based CLIs?The text was updated successfully, but these errors were encountered: