![]() ![]() Tmux send-keys -t test "./python_ver.sh" Enter # Sends the command you wanted to the session. Then you'd go: tmux new-session -s test -d # Creates a session named 'test' and stays detached. Basic tmux ls, shows the list of sessions tmux a, attach the detached-session tmux a -t , attach the detached-session to tmux kill.Tip: Get our Tmux keyboard shortcuts cheatsheet for a complete overview of basic keybindings. If the script is python_ver.sh (make sure the script is executable): #!/bin/sh If you want to detach from a tmux session, you can actually do that already by using Shell>Tmux>Detach, which can be invoked from an API using app. To leave command mode, either complete the command by pressing Enter or press the ESC key to exit without making changes. ![]() If the commands you want to send are in a script, you can send as a command the execution of this script: Tmux attach -t test # (Optional) If you want to attach to your session after the command was executed. ![]() # Here, the command was executed and the session is still alive. Tmux send-keys -t test "python3 -version" Enter # Sends the command you wanted to the session. You can achieve this by using the tmux send-keys command which sends commands to an existing session from the command-line (or a script): tmux new-session -s test -d # Creates a session named 'test' and stays detached. You can close the current window with: C-x (Your prefix Ctrl+a in the case of the OP, Ctrl+b by default) then & and confirm with y This shortcut kills the window but not the current session unless your are in the last open window. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |