GNU Screen and tmux are popular terminal multiplexers. One of the central features of such command line programs are to detach sessions from the actual user terminal emulators. The multiplexer is then running in the background, collecting stdout/stderr of the running shells and programs. When the user reconnects (this is typically not network transparent, but there are "extensions" such as https://tmate.io/), she can immediately continue to interact with the programs.