mfontanini / presenterm

A markdown terminal slideshow tool
https://mfontanini.github.io/presenterm/
BSD 2-Clause "Simplified" License
1.19k stars 29 forks source link

feat: Show `stderr` output from code execution #251

Closed dmackdev closed 3 months ago

dmackdev commented 3 months ago

This issue is split from https://github.com/mfontanini/presenterm/issues/247.

It would be great to show stderr output from code execution within a presentation.

This would:

Two main approaches were discussed in https://github.com/mfontanini/presenterm/issues/247:

  1. Capture stderr and show it separately after stdout.
  2. Interleave stdout and stderr output, to emulate exactly what you would see from executing the code in the terminal.

Regardless of the solution, we must still see the output interactively, i.e. we should see each line of output immediately as it happens, instead of all the output at once after code execute process exits. This maintains the current functionality, as can be seen in the bash snippet in examples/demo.md presentation, which has interleaved echo/sleep commands.