<div dir="ltr">Replies inline...<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 21, 2016 at 5:54 PM, Chris Fowler <span dir="ltr"><<a href="mailto:cfowler@outpostsentinel.com" target="_blank">cfowler@outpostsentinel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><div><br></div><div><br></div><hr><div><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><b>From: </b>"Dylan Northrup" <<a href="mailto:ale@doc-x.net" target="_blank">ale@doc-x.net</a>><span class=""><br><b>To: </b>"Atlanta Linux Enthusiasts" <<a href="mailto:ale@ale.org" target="_blank">ale@ale.org</a>><br></span><b>Sent: </b>Wednesday, September 14, 2016 10:42:12 AM<br><b>Subject: </b>Re: [ale] Tmux, where have you been alll my life?<br></blockquote></div><div><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br></div><span class="">Even if connections don't fail, I am not always working from the same host. James gets it exactly right for my use case. With tmux, I can encapsulate context around a specific task by having multiple windows (or panes in those windows) for a task. Tmux also lets me attach to the same session from multiple bash shells so I can move things around based on what I need to focus on with a keystroke instead of having to move a mouse or move windows.</span></div></div></blockquote><div><br></div><div>Can you explain a bit more. I know you can use tmux to connect to a socket. I could SSH into my desktop from anywhere and connect to its socket.</div><div><br></div><div>I install devices in the field and redirect output to different VTs. I could just start a tmux session as root, spawn programs to get and display the output instead? Is it possible to latch onto /dev/console?</div></div></div></div></blockquote><div><br></div><div>Let me make sure our nomenclature is correct. When I say "session" I mean "one instance of tmux, typically running on a bastion/workstation computer, where I will spawn multiple windows/panes in that session to either work locally or ssh out to remote systems". Once I have an instance of tmux running, I can run 'tmux attach-session' in another terminal window to get access to that very same "session" (and all of the windows/panes in that session). So, for instance, I can start tmux, create 4 panes in the first window (that you get for free), ssh to four different boxes in each of those panes, then create a new window, create four new panes, ssh to the same four boxes and begin tailing log files. Then (and here's the magic I was talking about), I can start up a new terminal window, attach to my tmux session, make sure I'm on the first window, and do some process restarts on those four machines while monitoring the log files in the previous terminal window. Oh, and I can synchronize the keystrokes in each of the panes, so I did "cd /var/log/foo; tail -F foo.log" one time, not typing it into four different windows.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><span class=""><div></div><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div class="gmail_extra"><span style="font-size:12pt">My work setup has four monitors that regularly have ssh sessions up on them. With tmux, I can move the current activity to the "primary" monitor and have others for referencing log files, man pages, running compiles, etc. that are related to what I'm doing on the primary window. Then, when I need to reconnect from home, I can do the same thing (albeit with fewer monitors) and have the current activity on one monitor and reference information on the other. And I don't need to reconnect to various hosts, re-run session commands, etc.</span><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">But, for me, the killer app for tmux is being able to do something akin to csshX inside a terminal without having to install anything on the box I'm sitting at other than an ssh client. Being able to run 'mwin {web,app,db}host-{dev,ref,<wbr>prod}{1,2}' and get an ssh session on 14 systems with multiplexed input to be able to work on all of them at the same time to be able to tweak a config, trigger chef/puppet, deploy a security patch, etc. is amazing.</div></div></blockquote><div><br></div></span><div>If you are on a system that has ssh client you'll just ssh to a remote system and execute tmux? </div></div></div></blockquote><div><br></div><div>No, I'll run tmux on the system with ssh, then ssh from the shells inside tmux session out to the remote systems. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><span class=""><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div class="gmail_extra"><span style="font-size:12pt">As far as "what is the tmux command to do X?" "C-b ?" is your friend (or, for folks like me who remap C-b to C-a, "C-a ?"). If anyone is interested in my tmux configurations (and helper scripts like 'mwin' listed above), I have them in </span><a href="https://github.com/dylannorthrup/dotfiles/" target="_blank" style="font-size:12pt">https://github.com/<wbr>dylannorthrup/dotfiles/</a><span style="font-size:12pt"> . My .tmux.conf is in the top level, helper scripts are under ~/.tmux and 'mwin' is under ~/bin. Happy to answer any questions folks might have.</span><br></div></div></blockquote><div><br></div></span><div>I'm curious about your setup I'll check your .dotfiles.</div></div></div></blockquote><div><br></div><div>If you (or anyone else) has any questions about this, I'm happy to answer them if I can. And let me know if anything I've said here needs more clarification.</div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Dylan Northrup<br>"Adversity is just change we haven't adapted ourselves to yet."<br> - Aimee Mullins</div>
</div></div>