I start tmux in first window of sessionA but using this command to wake it: ssh-agent tmux that I expect new nested sessionB will have its own ssh-agent listen for it. And output of ps aux | grep agent will show something like:

...    0:00 ssh-agent tmux

But instead I pass some options to tmux like: ssh-agent tmux <...> and expect ssh-agent still stay in-process for my new nested session, turn out it does but quickly ended/exited and the output of ps aux | grep agent doesn't show ssh-agent tmux <...> there.

So why ssh-agent tmux <...> get ended?

1 Answer 1


Complete answer:

If I put tmux <...> in subcommand I can keep ssh-agent tmux appears in output of ps aux | grep agent but now ssh-agent tmux is running in subshell that wouldn't terminate after server is killed.

EDIT for complete answer: I passed -d to detach when pass options to tmux so that killed ssh-agent process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.