Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to run a series of commands in tmux from a remote file like so:

tmux $(wget -qO- http://example.com/tmux)

The file contains commands like split-window and send-keys

The problem is, send-keys is stripping spaces. The send-keys commands is:

send-keys ssh example.com C-m;

But instead it sends sshexample.com

Any idea why?


share|improve this question

2 Answers 2

up vote 2 down vote accepted

As a guess, it's interpreting "send-keys ssh example.com C-m;" as four separate arguments and not knowing what to put between them.


tmux "$(wget -qO- http://example.com/tmux)"
share|improve this answer

I've struggled a bit with similar issue. The solution turned out to be:

tmux send-keys -l $var;
tmux send-keys C-m;

thanks to -l, tmux paid attention to all the signs. On the downside, it didn't accept <enter> so separated call is required.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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