Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

tmux $(wget -qO-

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 C-m;

But instead it sends

Any idea why?


share|improve this question
up vote 2 down vote accepted

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


tmux "$(wget -qO-"
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.