My usage profile of tmux is making many simultaneous ssh connections to remote hosts, and having these grouped together in a tmux session.
The only way I could do this programmatically is something like $ tmux new-window -d -t mysession: -n window-remotehost "ssh remotehost \"my shellcommandline on the remote host\"" I hope this already shows the problem: Both tmux and ssh only accept a shell commandline for launching a command. That means that the remote shell commandline has to be escaped twice, and thus can't be parameterized with a shell variable. I'd like to see that tmux also accepts positional arguments to be launched as a comamnd with execv(2) or friends, just like openvt(1) does it. For example, having an interface like $ tmux new-window blablabla -- ssh remotehost "my shellcommandline on the remote host" would remove one level of shell escaping and enable one to parameterize the command in a script: $ upgradecommand="apt-get update && apt-get upgrade && if some_condition; then do_something_silly; fi; whatever else there is to do" $ tmux new-window blablabla -- ssh remotehost "$upgradecommand" At the moment using shell command strings, there is really no way around doubly-escaping the command, so it is basically unworkable to write useful scripts. Not even saving the command to a shell script file would work because ssh would need the file on all remote hosts. I hope I could point out what bugs me. Would it be possible to integrate the positional args interface? Have a nice day -Jens Stimpfle ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users