Skip to main content
added 56 characters in body
Source Link

I was searching for a solution to this exact problem. It can be done using 'set-buffer' and 'paste-buffer' commands

tmux att -t <session-name> \; set-buffer "<command>^M" \; paste-buffer

Here is a complete example :

# let's start with two sessions running bash
tmux new -ts theOtherSession \; detach
tmux new -ts astropanic \; rename-window main-window \; detach

# attach to the 'astropanic' session, run a directory listing, output
# current datetime, then detach. Note for carriage return (^M) type ^V^M
tmux att -t astropanic \; find-window main-window \; set-buffer "ls;date^M" \; paste-buffer \; detach

# reconnect to check status
tmux att -t astropanic

I was searching for a solution to this exact problem. It can be done using 'set-buffer' and 'paste-buffer' commands

tmux att -t <session-name> \; set-buffer "<command>^M" \; paste-buffer

Here is a complete example :

# let's start with two sessions running bash
tmux new -t theOtherSession
tmux new -t astropanic

# attach to the 'astropanic' session, run a directory listing, output
# current datetime, then detach. Note for carriage return (^M) type ^V^M
tmux att -t astropanic \; set-buffer "ls;date^M" \; paste-buffer \; detach

# reconnect to check status
tmux att -t astropanic

I was searching for a solution to this exact problem. It can be done using 'set-buffer' and 'paste-buffer' commands

tmux att -t <session-name> \; set-buffer "<command>^M" \; paste-buffer

Here is a complete example :

# let's start with two sessions running bash
tmux new -s theOtherSession \; detach
tmux new -s astropanic \; rename-window main-window \; detach

# attach to the 'astropanic' session, run a directory listing, output
# current datetime, then detach. Note for carriage return (^M) type ^V^M
tmux att -t astropanic \; find-window main-window \; set-buffer "ls;date^M" \; paste-buffer \; detach

# reconnect to check status
tmux att -t astropanic
Source Link

I was searching for a solution to this exact problem. It can be done using 'set-buffer' and 'paste-buffer' commands

tmux att -t <session-name> \; set-buffer "<command>^M" \; paste-buffer

Here is a complete example :

# let's start with two sessions running bash
tmux new -t theOtherSession
tmux new -t astropanic

# attach to the 'astropanic' session, run a directory listing, output
# current datetime, then detach. Note for carriage return (^M) type ^V^M
tmux att -t astropanic \; set-buffer "ls;date^M" \; paste-buffer \; detach

# reconnect to check status
tmux att -t astropanic