You should start the shells in
tmux so they can be easily reattached in a new terminal.
screen this is done with the following steps:
Start the shell somewhere (e.g. in VNC):
screen -S myshell
Reattach the shell somewhere else (e.g. a new terminal with SSH):
screen -x myshell
While the methods above are highly recommended, they are not sufficient for controlling an existing shell. For that you are going to need some additional tricks.
One way to reattach an existing shell (that wasn't launched with
tmux) is to use
reptyr is a utility for taking an existing running program and attaching it to a new terminal. Started a long-running process over ssh, but have to leave and don't want to interrupt it? Just start a screen, use reptyr to grab it, and then kill the ssh session and head on home.
You can simply use the process id (PID) and tell reptyr to reattach it: