[Feature Request] Embedded PTY "iframes"
Allow programs, through an escape code going something like:
CSI_begin defineEmbeddedPTYRegionCode ; <x> ; <y> ; <w> ; <h> ; <PTY path> CSI_end
...to define a region of viewport/scrollback cells, which would be composited-over with a newly-spawned session, attached to a separate, already-existent PTY named by the escape-sequence.
The idea would be to allow programs/scripts that embed "unpredictable" software that is arbitrarily interactive, to "confine" that interactivity to a particular region of the screen. The software could create a separate PTY and hand it to the unpredictable process to use as its stdin/stdout/stderr; and then it could embed that same PTY within a region of its own PTY.
This "embedded PTY" session would act a lot like a pane or a tab — e.g. it would have its own transcript and be independently smooth-scrollable, searchable, etc. The major difference is that it would have its own kind of termination logic — neither "close pane" nor "log that session ended" nor "reset session", but instead just silently becoming a read-only scrollable transcript pane.
This is similar in purpose to the #503 proposal, but is complementary, rather than overlapping: output folding wouldn't work for programs that want to control the PTY entirely, or which use the alternate screen; but an embedded PTY would work to allow the output of these programs to appear "within" another program. (Of course, they would be best combined, such that the embedded PTY draw-regions could themselves be folded away!)