Is such a think possible under Linux?
Yeah I know I can tmux / nohup, and I know that if I dig deep enough I can manually reattach some of the file descriptors under /proc to get a working terminal for that process again…
… but is there a tool that automatically does this somehow?
e.g.
run -d ./bash long-running.sh > proc.file
### later
run -a proc.file
Edit: Y’all really know how to recreate the feeling of StackOverflow circa 2018


dtach is exactly what you’re looking for.
There are other similar tools. I personally found zmx to be the best, but it’s more feature rich than dtach, and might be more than you want. Dtach is pretty minimal. But my only issue with it is it struggles with reloading a terminal session for a TUI that needs non trivial redrawing.
Yeah! It got mentioned earlier, and I’ve started playing with it – it’s not perfect like you say, but it is good enough for what I need