Currently Clesh's shell-command uses sb-ext:run-program where the output goes to a stream
(with-input (input-stream (or input :none))
(let* ((process (sb-ext:run-program
*bourne-compatible-shell*
(list "-c" command)
:wait nil :input input-stream
:output :stream
:error :stream))
and the output is printed at once, when the command is finished. We don't see the output as it goes:
echo t; sleep 0.1; echo 2; sleep 0.2; echo 3
if we used uiop:run-program we could use :interactive outputs:
(uiop:run-program (string-left-trim "!" text)
:output :INTERACTIVE
:error-output :INTERACTIVE
:input :INTERACTIVE)
this will show the output as it goes.
And it works for visual commands such as top, sudo, vim…
The interactive input won't work on Emacs and Slime. We can still check the current terminal is not "dumb" with $TERM that shouldn't be "dumb".