SamVerschueren / listr

Terminal task list

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker console not supported

KristerV opened this issue · comments

Hey. When using this inside of a docker container all I get is plain text output:

[09:32:32] Get JSON [started]
[09:32:32] Read JSON [started]
[09:32:32] Read JSON [completed]
[09:32:32] Check JSON validity [started]
[09:32:32] Check JSON validity [completed]
[09:32:32] Get JSON [completed]

I understand this has more to do with docker than listr, but can't find any help anywhere. Perhaps someone here has found a solution?

This is because Docker doesn't use TTY. So my workaround is to hide the verbose stuff when there's no TTY.

const isTTY = require('tty').isatty(1)
[...]
task: (ctx, task) => myFunction(isTTY ? task : {})
[...]