Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tmux. Sending keys to a specific window

Tags:

tmux

If i have a tmux session called Test, and inside Test i have two windows Test1 and Test2. How do i send a command to say Test2.

tmux send-keys -t Test.Test2 "STUFF HERE" wont work. that syntax is for panes only

like image 941
power2 Avatar asked Sep 16 '16 03:09

power2


People also ask

What does tmux send keys do?

Send keys refers to a series of keystrokes that serve as an automated instruction to one of the terminal panes in the tmux window. By using send keys, you can automate certain processes in tmux panes. Send keys work by simulating keystrokes in a terminal.

How do you split a tmux window?

ctrl + b + % to make a vertical split. ctrl + b + " to make a Horizontal split. ctrl + b + left arrow to move to the left pane. ctrl + b + " to make a Horizontal split.

How do I change windows in tmux?

Ctrl+b, let go of Ctrl, Letf / Right / Up / Down will switch active panes.

How do I move a pane from one window to another in tmux?

By default, Ctrl + b , ! would break the active pane into a new window and switch to it. Where Ctrl + b is the default prefix for tmux.


1 Answers

Unbelievable. I searched everywhere for an answer on the web and I could not find it. Apparently it is just:

tmux send-keys -t Test:Test1 "TEST" C-m

like image 80
power2 Avatar answered Nov 18 '22 20:11

power2