#StackBounty: How to run a command when running a tmux socket session?

Bounty: 50

So, let’s say for example, I need to run a tmux socket between two users that runs

echo foo

To make this run on a normal tmux, it’d be best to do tmux new -d -s Foo "echo foo"

However, when running tmux using -S, I can’t seem to find a way to automatically run a command as the session starts. Let’s say our path is /home/user/tmux

I’d run tmux -S /home/user/tmux, and then on another account tmux -S /home/user/tmux attach. However, this doesn’t leave an opportunity to specify a starting command. Any way I could do this?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.