Detach the tmux session maint with Ctrl+B, D.
Reconnect to the same session after logging in again.
Which command is appropriate?
tmux attach -t maint attaches to an existing session; detaching does not terminate the session or its processes.
Detailed explanation
tmux new -s maintIncorrect. new creates a new session instead of attaching to maint.
tmux list-windows -t maintIncorrect. list-windows displays windows but does not attach the client.
tmux attach -t maintCorrect. tmux attach -t maint reconnects to the existing session.
tmux kill-session -t maintIncorrect. kill-session terminates the session.
Try it yourself
An example you can run in a temporary verification environment.
tmux -V 2>/dev/null || trueExpected result
tmuxがあればversion。serverやsessionは起動しないKey points
- tmux attach
- -t
- Session persistence
Notes
- Environment: tmux version確認のみ
- Use a disposable process or test shell when checking lifecycle commands.
- Exact output and option names can vary slightly by distribution and tool version.
Foundation review
Place the operation
tmux new creates a session, while attach reconnects to one that already exists.
Check the side effect
Confirm the target session name with tmux list-sessions before attaching or terminating it.