demoshell icon indicating copy to clipboard operation
demoshell copied to clipboard

Test with programs that have progress bar output

Open dhellmann opened this issue 7 years ago • 3 comments

Git clone or curl for example. Probably need to do some basic handling for control characters like backspace and line feed

dhellmann avatar Mar 11 '18 22:03 dhellmann

I wonder if using a different widget to hold the output of each command would make this part easier?

dhellmann avatar Mar 11 '18 22:03 dhellmann

At the very least, you'd want an editable single-line buffer, to handle horizontal cursor movement and clears.

A big solution would be a full-blown sub-terminal. I did once write a library to do this (included in https://github.com/kilobyte/termrec) but it's 1. in C, 2. neglected for a decade, thus I can't honestly recommend using it.

Thus, you might want to spawn a pty, run regular capture with only single-line editing, then once you see any vertical cursor movements or such, switch to blind pass-through. This would let less, mc or anything full-screen work well.

kilobyte avatar Mar 12 '18 11:03 kilobyte

I'm trying to keep in mind that this doesn't have to be a full-blown shell capable of day-to-day use. The types of commands I want to support are relatively quick things that produce minimal output that someone would actually show in a live demo.

That said, people do tend to like to spend time installing things in a demo for some reason, so I want to support tools that show horizontal progress bars.

I thought original of providing builtins for less and more, since those are pretty commonly used, but not going further than that. OTOH, maybe spawning a pty for some commands does make sense. In that case we would need a short list of commands for which a pty should be spawned so we can compare the commands being run with the list.

dhellmann avatar Mar 12 '18 12:03 dhellmann