Is there any way to make a bash script enter a certain keystroke? What I'm trying to accomplish here is a script that will run Ctrl+B to exit tmux.EDIT: I see that several people are saying that it's better to use a program - specific command. What if I wanted to edit a text file (in this case the bash_aliases file) using a bash script?
Is there a way to make a Bash script enter a certain keystroke?
bash;shell script;tmux
If you want to interact with tmux in a script, that's where you want to use tmux ... tmux-command. Like:tmux kill-sessionTo exit the current session.tmux kill-serverTo exit the server (kills all sessions).tmux detach-clientto detach a client (exit, but you can reattach later).