Open yarikoptic opened 3 years ago
I think we should provide context manager, similarly to what pyout did recently: https://github.com/pyout/pyout/pull/126 and then may be centralize at the level of the WitlessRunner protocol(s) which would output to the screen.
What is the problem?
If
run
(or in my caserun_procedure
uponcreate
withinaddurl
) is not expected to interact with the user, to avoid interference with progress bars and/or any other logging which might be happening in parallel, it is desirable to "capture" and re-output output from the external command viaui.message
(which would first properly clear all progressbars, output, and then redrawn progressbars). Without that, output fromcfg_
procedures totally ruins UX in parallel execution (#5022). The question is how decision should be made either it is interactive or not I guess - should be required to be explicit (cat /dev/null |
), or some procedures could "announce" that they would not have any interaction needed, or higher level function (e.g.addurls
) would do that, ...OR alternative -- we make
WitlessRunner
without protocol which swallows output to be threadlocked (and force cleaning up of the pbars before and restoring after)... That would cause some slowdown but probably could be tolerable