8/31/2023 0 Comments Tmux vertical split![]() # again, specifying pane 1 with '-t 1' is optional # we now have two panes in myWindow: pane 0 is above pane 1 ![]() Tmux send-keys -t asdf:myWindow.0 'tail -f foo' C-j # for the key, we can use either C-m (linefeed) or C-j (newline) # I'm doing it so explicitly to show you how to do it. # I address the first pane using the -t flag. Tmux new-session -s asdf -n 'myWindow' -d Note the -d flag, we do not want to attach just yet! This might not be the simplest or cleanest way, but it usually works: #!/bin/sh For me it's always easiest to think about how I would achieve my goal manually and then translate that into tmux commands. Here's a shell script that works along the lines that you tried. The two tail commands aren't run in an interactive shell, so if you exit them both, the window myWindow will be destroyed (together with the session if you haven't created any more sessions. It doesn't scale very well (a few more commands and the result is incomprehensible). There are a few drawbacks to this solution: Split-window -d 'tail -f bar'\ attach-session ![]() Here's a quick and dirty command-line that achieves what you want: $ tmux new-session -s asdf -n myWindow -d 'tail -f foo'\ \ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |