http://nothingtogein.weebly.com/police-investigationcourt-trials.html
“Ed Gein was soon arrested and held in jail for more than 30 hours, refusing to talk to any one. It wasn’t until he was confronted with Bernice Warden’s corpse and a slice of apple pie with cheddar cheese that he began to discuss the murders.”





Maybe I’m misunderstanding what your requirements are, but screen may be what you need https://www.man7.org/linux/man-pages/man1/screen.1.html
You might also be able to background the process:
https://linuxize.com/post/how-to-run-linux-commands-in-background/