12/28/2023 0 Comments Tmux new window![]() ![]() I spend just the right amount of debugging time figuring out that I need to give execution permissions to the johndoe. I create a bash/zsh alias to source this session configuration :Īlias tmuxjohndoe='.# (you might want to add "-t johndoe" here if you need several sessions running in parallel) # Attach the current terminal to the only session available Tmux send -t johndoe:'API run' 'dotnet run -no-build' Enter Tmux neww -t johndoe -n 'API run' -c ~/dev/own/johndoe/back-end/Api Tmux send -t pers:'UI run.1' 'npm run dev' Enter # Simulate user entering a command to the second pane in this window Tmux split-window -t pers:'UI run' -h -c ~/dev/own/johndoe/front-end 3 Plagiarized and altered a bit from another of my answers, heres an example: TMUXSESSIONNAMEscratch tmux new-session -d -s TMUXSESSIONNAME >/dev/null tmux new-window -t TMUXSESSIONNAME tmux send-keys -t TMUXSESSIONNAME:1. Tmux send -t pers:'UI run.0' 'git status -short' Enter # Simulate user entering a command to the first pane Tmux neww -t pers -n 'UI run' -c ~/dev/own/johndoe/front-end # Create a new window in the target session, with the title 'UI run' Tmux send -t johndoe 'docker compose up -d' Enter # in the target session named (-t) johndoe # Simulate the user entering some docker command in the first window available Tmux new -d -s johndoe -n 'Main' -c ~/dev/own/johndoe # ignore the rest of the session definition Without -d, tmux would open the client right away and # The -d is for detached mode, which allows me to continue defining the rest of the session This file is simple to maintain because it does not have a myriad of \ everywhere like I saw in other answers: # Create a new session named johndoe, with a first window named Main I want being able to spawn this very quicklyįor my project named johndoe, I create a nf file which is essentially a bash script, somewhere in my configs ( ~/.config/tmux/tmux-sessions/nf).I want to focus the window I want at the end of the script. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |