Use tmux or something like it (I now use zmx[1]).
I do not know if you read my initial commment, but MacOS Terminal (native app) has this feature. And it is not a terminal multiplexer like tmux or what you proposed.
> A terminal multiplexer... is useful for dealing with multiple programs from a command line interface, and for separating programs from the session of the Unix shell that started the program, particularly so a remote process continues running even when the user is disconnected.