I'm wondering if the solution for the block separation could be to have separate tty (or pty?) for each block. I guess that wouldn't work too well with existing shells though
That might be interesting for supporting multiple blocks running at once without confusion, as an update to the classic shell job control. Highlighting stdout vs stderr differently, too.
Another dimension to consider is the possibility of nested blocks: subshells, ssh, programs with their own REPL, etc.
That is how I thought it worked first. That each pty executed its own shell instance and passed their environment and current working directory between them. Perhaps that would be a very naive approach that couldn't work in practice
Another dimension to consider is the possibility of nested blocks: subshells, ssh, programs with their own REPL, etc.