<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>On Sun, Sep 11, 2022, at 13:55, Khalid Baheyeldin wrote:<br></div><blockquote type="cite" id="qt" style=""><div dir="ltr"><div>I do the same with screen ... <br></div><div><br></div><div>I have a screen session always on my home server with connections/sessions to <br></div><div>other servers and such.<br></div><div><br></div><div>I scripted this over a decade ago, by having a shell script called checkscreen<br></div><div>run from .bash_profile with the following<br></div></div></blockquote><div><br></div><div>I use the built-in functionality with screen to do this using named screen sessions:<br></div><div><br></div><div>    $ screen -DR devel<br></div><div><br></div><div>If 'devel' session doesn't exist, it creates it. If it does exist, it connects to it (including disconnecting another terminal you may have already had connected -- in case you left it connected from another place). It won't conflict with other sessions with different names.<br></div><div><br></div><div>I also have a function in my bashrc for is_in_screen, which is used to set a custom bash_history when in a named screen session. So my 'devel' session keeps separate history from 'testing', etc.<br></div><div><br></div><div>Myself, I looked at tmux, and didn't see any benefits to my use -- just a lot of re-learning to do what I've already been doing. That said, I work at a RHEL shop, so I'll probably have to adapt at some point.<br></div><div><br></div><div><br></div><div id="sig91988184"><div class="signature">-- <br></div><div class="signature"><b>Chris Irwin</b><br></div><div class="signature"><br></div><div class="signature"><span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">email:   chris@chrisirwin.ca</span><br></div><div class="signature"><span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">  web: <a href="https://chrisirwin.ca">https://chrisirwin.ca</a></span><br></div></div><div><br></div></body></html>