In addition to
tmux there's also
nohup. It is simpler but sometimes better depending on your exact situation. See here: nohup vs. Screen for more details.
nohup would keep the process in foreground but you won't be able to interact with it or see the outputs on the terminal. To start the process in background add
& when starting the process (i.e.
nohup <your command here> &).
If the process is alrady running with
nohup you can re-gain access to the terminal by pressing
Ctrl+Z (stop process) followed by
bg command (send stopped process to background).
EDIT (after OP comment):
I'm not sure I understand the scenario but maybe you could try that:
- open terminal window (some shell will start inside)
- explicitly start another shell (e.g. bash) inside that window
- start your foreground process inside the second shell (without any
- open another terminal window
- identify the "middle" shell (it will be the parent process of the tested process)
- send kill signal to the "middle" shell.
This turns the tested process into a "semi-daemon" and gives you access to the top level shell in the first terminal window.
Note that the tested process is still attached to the terminal so it will be terminated when you close the window.