Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe provide some fallback if not on a TTY #11

Closed
andywer opened this issue Jul 13, 2016 · 7 comments
Closed

Maybe provide some fallback if not on a TTY #11

andywer opened this issue Jul 13, 2016 · 7 comments

Comments

@andywer
Copy link
Contributor

andywer commented Jul 13, 2016

Hey!

For https://github.com/andywer/npm-launch I was thinking about a plain-text fallback in case !require('tty').isatty(process.stdout). Right now you get all those control characters in the output when piping to a file or similar. In my particular case I have Jenkins/Travis builds in mind.

But maybe you are interested to solve that edge case directly in Listr?

bildschirmfoto 2016-07-14 um 00 29 48

@jokeyrhyme
Copy link

Without a tty, colors and backtracking / replacing existing output is impossible. So perhaps the output just needs to drop all animations and colors?

Perhaps:

  • only output the tasks one by one, not all in advance
  • for each task, output its text, and an ellipsis, and then "done" or an ASCII smiley or something when it's finished

E.g.

npmList ...
npmList ... done
runStandardLinter ...
npmList ... done
runStandardLinter ... done
wasteSomeTime ...
npmList ... done
runStandardLinter ... done
wasteSomeTime ... done

@jamestalmage
Copy link

Or just go verbose.

START <TASK_NAME>
task output
task output
task output
END <TASK_NAME>

If I am hunting down a problem in a Jenkins / Travis build, missing log data I suspect might be relevant is going to be a lot more frustrating than it is locally, where it is easy to rerun.

@andywer
Copy link
Contributor Author

andywer commented Jul 14, 2016

I guess ideally you could trigger "plain text output without control chars" and "verbose output" independently.

So it might be something like

↳ START <task>
✔ END <task>

or (if verbose)

↳ START <task>
task output
✔ END <task>

@andywer
Copy link
Contributor Author

andywer commented Jul 14, 2016

PS: But yes, verbose mode alone would also work for me right now 😉

@sveisvei
Copy link

Should be possible to activate with CI=true or/and LISTR_OUTPUT=simple or something along these lines.

@andywer
Copy link
Contributor Author

andywer commented Sep 16, 2016

listr-verbose-renderer almost does the job.

Just need a way to show all output if necessary (SamVerschueren/listr-verbose-renderer#1) and implement auto-switching to verbose renderer when in a CI scenario, piping to a file or similar.

@SamVerschueren
Copy link
Owner

Moving the discusion to #33. PR was added to add this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants