Skip to main content
Back to Commands
MiscellaneousN/A (used in scripts)

send-keys

Short form: send

Send keys to a pane. This is useful for scripting tmux to automate commands.

Synopsis

bash
tmux send-keys [-FHlMRX] [-N repeat-count] [-t target-pane] key...

Options

FlagDescription
-lDisable key name lookup (send literal string)
-RReset terminal state before sending
-HKeys are hex codes (e.g., 0x41 for 'A')
-N repeat-countRepeat the key sequence N times
-t target-paneSend to specified pane

Examples

Type and execute 'ls -la'

bash
tmux send-keys 'ls -la' Enter

Run npm start in pane 1

bash
tmux send -t 1 'npm start' C-m

Send Ctrl+C (interrupt)

bash
tmux send-keys C-c

Send literal 'hello'

bash
tmux send-keys -l 'hello'

Default Keybinding

N/A (used in scripts)

Default prefix is Ctrl+b

Pro Tips

  • Use C-m or Enter for carriage return
  • Great for startup scripts that need to run commands in panes
  • C-c sends interrupt, C-d sends EOF