With this command line all three commands run in the shell inside tmux.

There is no way you can run a command inside tmux and have it inject
into the shell outside tmux.

The only thing you could do would be run tmux in a loop outside like

while :; do
      tmux attach || break
      tmux showb|pbcopy
done

But that would obviously not let you detach.


On Tue, Dec 28, 2010 at 04:05:45PM +0000, Chris Poole wrote:
> I'm running tmux on a Mac, and want to use pbcopy and pbpaste.
> 
> As a workable hack, I tried adding this to my .zshrc:
> 
>     alias tmuxcopy='tmux detach && tmux showb | pbcopy && tmux attach'
> 
> Ideally, I want one command to run in tmux (bound to a key), which
> will detach the current session, paste the latest buffer into the
> Mac's clipboard, and then attach to the tmux session.
> 
> Running this alias in my tmux session detaches correctly, but then the
> other commands don't run, as (I assume) the session is stopped.
> 
> I can of course manually detach, then have an alias to showb | pbcopy
> && attach, but I'd like one command to do this.
> 
> Is this possible?
> 
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and, 
> should the need arise, upgrade to a full multi-node Oracle RAC database 
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to