You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are times when you need to shutdown your laptop, and you want a server process (like a chromium compile) to run in the background.
TMUX manages this very well. you dont need to figure some weird "&" syntax or anything
For this example, let's suppose you're running a long running task like running rspecs on your project and
it is 5pm, and you need to go home.
Run Your Process
1. First launch TMUX
$ tmux new-session -A -s sss1
Start a new session or attach to an existing session named sss1
2. Run your long running process
$ something long long long
3. Detach from TMUX
Simply press [CTRL]+[b] (together and then leave them), then [d]. This will detach your session from TMUX.
NOTE: you can do this while your long process is running. Dont be afraid!
4. Log off
Now you can simply log off
Show all sessions on the computer
$ tmux ls
this will show you all running sessions
root@Ubuntu-2404-noble-amd64-base ~ # tmux ls
sss1: 1 windows (created Sat Aug 31 21:31:41 2024)
sss2: 1 windows (created Sat Aug 31 21:31:44 2024)
Return to your session
When you return back to your desktop, open a terminal and simply run:
$ tmux new-session -A -s sss1
This will attach to your detached TMUX session. you will see all the screen output and everything. its just like as if ur terminal was running and you just opened it now. no mess of background processes.
Anytime u want to detach again, simply press [CTRL]+[b], then [d]. to exit, just type exit in ur tmux session. that session ends.