Capture build Output terminal

Hi There,
I’m new here, and sorry if answer has already been answered but I did not found it here nor on google. And it drive me crazy.

I’m using pio with ESP32, all works fine but I need to capture compilation terminal output. Why can’t I just select output to do “copy”?

I saw somewhere a pio run >>file.log but the output does not contains the compilation error that are on the screen when I build without redirection.

Don’t tell me I’m the only one having this issue?

Thanks for your help

I can answer the second part of that question: Error messages get written to stderr instead of stdout. Now depending on your operating system you can redirect streams, in particular stderr to stdout.

Linux (possibly also Mac):

pio run > file.log 2>&1

Windows:

pio run 1> file.log 2>&1

For the first part: If you run it from terminal you should still be able to select and copy-paste the output. Or are you running it inside some IDE? What OS/IDE?

@maxgerhardt, thanks, my fault I totally forgot to mention, I’m on Win10 in PIO Integrated IDE (no terminal)

And this line works great under windows

pio run 1> file.log 2>&1

Thanks for all, to be honest, It’s the first ide I can’t select what is displayed on screen ever, but I can live with it :wink:

Remember you can always tell PIO to generate project files for other IDEs if you don’t like the supplied one. I personally like CLion, Visual Studio Code and Eclipse :wink: (pio init -h)

I’m coming from Sublime/Arduino/Nodepad++/Vstudio but I like PIO no problem :wink: