Display all output when no prompt was found?
I think it might be useful to put all output into the scratch buffer in case the expected prompt was not found.
This would help with issues, where e.g. rlwrap complains rlwrap: error: My terminal reports width=0 (is it emacs?) I can't handle this, sorry!.
In this case the scratch buffer could have a note that something failed and provide that output (which means to remove the input that codi sent itself, if it was echoed).
(btw: I have noticed the rlwrap problem with Vim, but not Neovim btw. Likely related to the not yet implemented "term" option (see :h job-term).)
One problem you're going to face with this is the fact that Codi attempts to line up REPL output to the source buffer's line.
At the most this would be a debug option and I wouldn't be surprised if it already existed (it does in logs, but I don't know if the logs go to the scratch buffer like you'd expect).
The error case means that there is nothing to line up, but only the error. This could be also detected through the exit code maybe additionally. The logs are not put into the scratch buffer, but into a file.
This is currently not possible because the code keeps count of the number of prompts seen until the expected number is reached, at which point it ends the process and shows the output. In your example, Codi would be waiting for a prompt that never comes. However, it can't just display the output, as it doesn't know whether or not the program is just taking awhile to display the first prompt. Maybe some sort of timeout for the first prompt would be helpful, as that should always be quick on most repls.
My idea was to handle this when the output/job is done: if there was no prompt found, (and/or the exit-status is non-zero) it would display the last line(s) from the output.
I suppose that could work. I don't have the bandwidth to do more feature work on Codi at the moment, but I would happily accept pull requests for this.
I also think this would be sweet. Maybe if it just dumps the codi.log to the buffer? Would really speed up debugging.
I'm new to Vim, so I doubt my Vim Script would be up to par. Codi's part of my daily workflow though; thanks for the plugin.