I used to enjoy Tmux, then noticed I didn't need its core persistence/session feature; I mostly used it for windowing & tiling, which are okay but come with <i>lots</i> of warts you need to avoid, and before you know it your tmux.conf is 150 lines of stuff copy-pastaed from StackOverflow and the Arch wiki, mouse & copying keep being janky, and you're in for long sessions of configuration whack-a-mole where each fix somewhere breaks something somewhere else. Also, the client/server architecture is great if you need it, but for everyday development I don't, so I'd rather avoid the extra layer.<p>Not blaming the authors/maintainers at all, they're responsive and Tmux is extremely reliable. But in the end, it feels like they're battling to implement features at the wrong layer, and UX suffers.<p>In the end, I realized I just wanted a good terminal emulator that is {fast, featureful, scriptable, keyboard-friendly}.<p>If that sounds familiar, give Kitty a try: <a href="https://sw.kovidgoyal.net/kitty/" rel="nofollow">https://sw.kovidgoyal.net/kitty/</a> (and run <a href="https://fishshell.com/" rel="nofollow">https://fishshell.com/</a> in it, but that's another discussion :)
> sudo apt-get install tmux (Ubuntu and derivatives)<p>I believe you just insulted the entire Debian community.<p>Jokes aside, tmux reminds me of emacs (similar esthetics & key bindings), the same way screen reminds me of vim (how do I get out of this thing?)
Having being a `screen` user for over two decades, migrating to tmux has been a pain. A week ago, however I discovered a wrapper called `byobu` (1) which really helps, and controls both screen and tmux depending on which one you have on your system. It basically wraps Function keys and more to tmux, but has plenty of other features. Time will tell if it was worth installing, but I do believe it's simpler for me to use it as a transition from screen.<p>(1) <a href="https://byobu.org" rel="nofollow">https://byobu.org</a>
While on the subject, I'd like to share a solution I came up with for nested sessions:<p><a href="https://github.com/xelxebar/tmux-addons/tree/master/nesting" rel="nofollow">https://github.com/xelxebar/tmux-addons/tree/master/nesting</a><p>Essentially, it defines some keys that let you "focus" on a particular nesting level. I've had some instances of needing four levels of nesting and found this to be quite nice.<p>The configuration is a tad idiosyncratic due to the way tmux handles variables, but it should be pretty well document in the readme.<p>Hopefully, someone else finds it useful. I've had to deal with sessions four levels deep and found this relatively ergonomic.
Holy cow tmux has changed my life.<p>No longer do I have to worry about losing all of my process when I accidentally close iTerm.
This, coupled with the fact that you can Ctrl-B Ctrl-B and control your tmux within tmux...
It's even fairly easy to script and make awesome workflows. Take for instance this script which shows a diff in a left pane and a commit editor in the right pane: <a href="https://gist.github.com/nvahalik/36108d4b892b6f66982537235f9cf462" rel="nofollow">https://gist.github.com/nvahalik/36108d4b892b6f66982537235f9...</a>
I spent a while trying to file down some of the rough edges around different versions of tmux and compatibility with shells / colors / vim / scrolling / weird keycodes / etc. and have some commented dotfiles here:<p><a href="https://github.com/ohazi/dotfiles" rel="nofollow">https://github.com/ohazi/dotfiles</a><p>It still has warts, but hopefully this is a useful reference to someone... I still haven't found a single source that covers all of these things well. Tmux config is surprisingly unintuitive.
>>> I’ll proceed to give them a two minute tour about what you can do with tmux. After that they’re either hooked and want to try it themselves or they tell me to go away with my ancient neckbeard tools and just use iTerm2.<p>FYI, iTerm2 actually has a tmux integration. Allows you to get the best of native paneling and persistent sessions.<p><a href="https://www.iterm2.com/documentation-tmux-integration.html" rel="nofollow">https://www.iterm2.com/documentation-tmux-integration.html</a>
To me, tmux only makes sense for remote servers. Why would I want to use it for local terminal sessions? Why not just have multiple terminal windows open? And multiple desktops instead of "sessions", etc?<p>I use tmux with iTerm integration when SSH'd into remote machines, so that my tabs/window layout are preserved on the remote server when I reboot/reconnect.<p>But why would I need that locally? iTerm <i>already</i> saves my windows and tabs/layout/etc... because I <i>don't close them</i>.<p>Using tmux locally just seems like extra steps... when should I "actually" close a window, and when should I just detach it? Why is the distinction even important? If I don't want to see a window I can just minimize it, and if I want to actually close it, I can just... do that. Maybe because tmux has nice keyboard combos for doing window arrangement? But couldn't I just set up my window manager to do the same?<p>Remote servers though, totally makes sense. Sometimes you have to disconnect your SSH session, so that you can reboot your local machine while leaving the session open. tmux is a necessary thing in that regard. But on a local machine, rebooting means I'm clearing all my state anyway, so what would it really mean to "resume" a tmux session?<p>Maybe I just don't get it?
If you're a Linux user, a logical extension of this idea is to use a tiling window manager, and then you get the paneled window management for everything, not just your terminal.<p>Being able to detach and re-attach to sessions is still really useful, but I never find myself wanting to use tmux for splitting up a terminal window when I'm already using a tiling window manager.
I spend most of my day in terminals. If you are mostly just after tiling windows then I prefer, Tilix on Linux or iTerm on Mac OS. The only time I use tmux is if I am worried about losing my ssh connection and don't want my process to die.
Usually the title of my terminal window displays some useful informations (e.g. the directory I'm currently in, or if I am installing some packages and their dependencies with "emerge somepackage" then I see what I'm currently emerging, etc...).<p>Does anybody know how to display the exact same informations in Tmux' bottom green bar? I just want it to display the same stuff that I would otherwise see in the window title of my terminal emulator.<p>I tried to search for it but I'm probably not using the correct terms so I didn't find anything that is relevant to this.
Can anybody tell me how to scroll up in a tmux session? Whether I use mouse scroll wheel or keyboard, on scrolling up all I get is<p>^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A
I spend about 70+% of my day in tmux. I usually have 15-16 windows (which I work <i>hard</i> to keep pared down), and some key windows with 6 panes (that I have muscle memory regarding what they are precisely doing). I've got a fairly tight 242 line .tmux.conf that I git sync between my various workstations, with affordance for Linux/macOS/WSL to handle things like the clipboard.<p>In addition to just keeping all my states managed cleanly, a couple of the many key features that I love about tmux:<p>o No need for a mouse - this has been a life saver in the past when I was working on a customer site, and they had me locked down on a terminal environment where there wasn't any mouse pass-through for things like copy paste.<p>o tmux restore/resurrect are a godsend. I can do weekly kernel updates on windows-fast ring/lose power, and get all of my sessions and scrollback history<p>o A side benefit of the restore/resurrect capability, is that I can tar-ball my session state and have all my scroll back and commands on a separate system.<p>One of nice tweaks that has made a difference for me is creating new-windows and <i>requiring</i> they be named -<p><pre><code> bind-key u command-prompt -p "WinName: " "neww -n %1"
</code></pre>
that Ensures all my windows have a name that makes sense.<p>Love tmux, though, you can go down a rabbit-hole tweaking out your .tmux.conf.
Is there a way to copy the whole tmux window buffer over ssh connection to a Linux or Windows system? So far I only saw iterm2 tmux control mode supporting this on osx. I saw lots of terminals have feature requests open for this functionality but none of them have traction on getting this feature implemented due to the lack of tmux control mode documentation. Terminator has a fork release supporting it but it did work well when I tried it.
One more interest feature which was not clearly described: you can attach two or more ssh connections (belonging to the same system user) to the same tmux session. Each displays the same thing in real time and has full control.<p>We use this all the time for these two use cases:<p>1. Semi-permanent connections to the same tmux session on the server from multiple locations e.g. work and home. Come home and find things exactly the way you left them at work, and vice versa.<p>2. A sort of collaborative environment. We have something like “demo” user running tmux session, and multiple people from different remote locations login as “demo” and attach to the same tmux session. Again, everyone has full control and we can see each other’s actions as we also talk on the voice call in parallel. Usually much better experience vs. some sort of screen+control sharing solution, especially when some participants are on low-quality connections.
Suggestion for your bash_login or equivalent, to automatically get back your session based on the IP you connect from (6to4 safe):<p>REMOTEIP=`echo $SSH_CONNECTION |sed -e 's/::ffff://g' -e 's/ .*//g'`<p>if [ -z "$SSH_CONNECTION" ]; then if [ "$TERM" != "tmux" ]; then tmux attach -t $REMOTEIP || tmux new -s $REMOTEIP ; fi ; fi<p>I have static IPs and I like to come back to a server the way I left it the day before, from home or work.<p>For pratical reasons (everything in one window), I often have tmux running inside GNU screen, with one GNU screen per remote server.
I don't go too crazy with tmux stuff, I am a very minimal user<p>This is how I tend to start/restore a session:<p><pre><code> alias foo='tmux a -dt foo || tmux new -s foo'</code></pre>
I wouldn't personally say that tmux is superior to something like iTerm2, but on WSL (Windows Subsystem for Linux) there doesn't seem to be a superior alternative since I haven't found a decent terminal on this OS that supports tiling.
You can also run tmux within Emacs. Start a term via <ESC>x then enter term and press return. You can now run tmux. Use Ctrl-C Ctrl J and Ctrl-C Ctrl K to switch between modes.
tmux could really do with a 'vim-sensible' common sensible default configuration.<p>Mirroring typical linux mouse copy-behaviour is perticularly painful (esp. in a multi-pane setup).