Earlier quoted context omitted.
> Can you switch mode once the executable's already been launched, though? Yes, apps can change terminal mode at any time. The solution the author went with is to have a list of "visual program" names, and when a visual program name is detected, launch it in an external terminal (xterm or Emacs vterm). That is making no attempt to handle mode switches during program execution, it is making a permanent decision before…
Thanks for the suggestion. The "widget" you are talking about seems to required some specific support from the host REPL, no? Could SLY do it? Could graphical Emacs do it?
I think the other problem is that it is easy to launch a new buffer in Emacs hosting the terminal emulator. But what I was suggesting was more like embedding a buffer inside an existing one. I don't know if Emacs has that feature, but if it doesn't, again there is no reason why someone couldn't add it. (I don't know if Emacs Lisp is sufficient to implement such a feature or if extensions to the C code would be necessary.)