11 ms·
Tmux is worse-is-better
- syslog 2y ago„If you want to walk the path of true digital minimalism, vanilla Vim and tmux or its spiritual grandfather screen are all you need.“ I think I‘ve been walking this path for twenty years now.
- neilv 2y agoBasic `screen` or `tmux` awareness (how to start it, how to create and switch between windows, how to reattach if disconnected) should be in the toolkit of anyone who finds themself needing to SSH into a server. Especially in startups, where you can't afford to be sitting atop massive too-big-to-fail enterprise bureaucracy, and need to understand the systems, and work creatively and efficiently with them.
- noloblo 2y agoi use neovim and screen as defaults and find them quite useful, but never found tmux useful, please change my mind tmux what are good starter tutorials?
- SoftTalker 2y agoscreen and tmux are similar. Unless you need some of the more obscure features, they mostly do the same things. Screen can attach to a serial port, not sure tmux can (but you can use 'cu' or another utility for that in a tmux window).
- Graziano_M 2y agoTmux lets you make a pane toggle full screen. That’s reason enough for me.
- mh-cx 2y agoAs tmux can be extended with plugins I'd recommend to check through this list and see if you find something useful: https://github.com/tmux-plugins/list https://github.com/tmux-plugins/list As a neovim user I can also very much recommend this vim plugin to seamlessly navigate between tmux panes and neovim windows: https://github.com/christoomey/vim-tmux-navigator https://github.com/christoomey/vim-tmux-navigator
- nurple 2y agoThis is a killer feature IMO. Bind the ctrl-hjkl in vim/neovim for navigation and go between vim panes and tmux panes transparently, beautiful.
- devsda 2y agoIn screen, splits and windows behave more like vim buffers and splits. That works nice for an editor because I might want to look at the same file at two different locations. I find it weird to apply that concept to shells. Tmux panes and windows behave more like separate shells. It's similar to what we get with individual shell gui windows that are neatly stacked and makes it easy to follow. I don't know if there is an equivalent in screen, but I like and heavily use the zoom feature which can temporarily minimize other splits and focus on single shell.
- kzrdude 2y agoTmux does the same job as screen. I didn't want to before, but now in the current year I switched from gnu screen to tmux, keeping the key bindings the same. Ending a 15 year or so streak. The reason is that tmux supports more modern features like hyperlinks and truecolor, in the distro versions. Once settled, I don't notice a difference.
- sshine 2y agoHow does tmux support hyperlinks? My virtual terminal (iTerm2, Alacritty) makes mouse-clicking a link opens it in Firefox. I've used GNU screen for 25 years. I gave tmux a try 10-15 years ago, but I didn't see the upside. I'm curious about Zellij and its wasm plugins, but equally skeptical. All I ever do in screen is ^A D, ^A C, ^A SPC, not sure what else I need?
- kzrdude 2y agoHyperlinks refers to "OSC 8" which is an escape code for making clickable links. for GNU Screen (released versions in my distro) this is an unknown escape and is stripped, tmux "passes it on" to the surrounding terminal and it is then usable. Programs such as GNU coreutils ls (ls --hyperlink=always) can use hyperlink escapes in the outputs to make every file name it lists clickable, for example. Of course there are ways to escape these escapes and get them to pass through screen - I wrote an escape code script myself to do it - but that experience is still inferior to native support, which tmux has nowadays. Well I used GNU screen for a long time but it finally broke through now due to truecolor, and I managed to switch :) I tested both zellij and tmux before switching, I was considering zellij as the first alternative. But zellij had some noticeable performance problems compared to tmux when it comes to throughput of terminal output, so I picked tmux.
- kzrdude 2y agoSee Neovim v0.10 changelog for how they use hyperlinks/OSC 8: https://gpanders.com/blog/whats-new-in-neovim-0.10/#hyperlinks https://gpanders.com/blog/whats-new-in-neovim-0.10/#hyperlin...
- 2y ago
- CoastalCoder 2y agoIIRC, iTerm2 has special support for tmux. E.g., tmux panes get corresponding iTerm2 panes?
- lelanthran 2y ago> i use neovim and screen as defaults and find them quite useful, but never found tmux useful Thank heavens there's someone else - I thought I was the only one[1]. [1] I use screen, and then use vim with multiple splits and tabs, with each buffer being a `:terminal`. Works very for me, because I get all the terminals I want, splitted and tabbed in any fashion I want, using my existing vim muscle memory to switch between them, minimise, maximise, etc. Also, takes about 1s to save the session if I ever feel the need to exit vim (I never do, though).
- skydhash 2y agoI started with screen and then move to tmux (don't really remember why). I've never been a fan of :terminal. I start and quit Vim multiple times a day (even for the same project) and opening new tmux pane or tab is the reflex for me. I rarely use tabs in vim. My philosophy is that buffers are like sheets of paper on my desk. I rearrange them based on what I want to do. Moving to another tab is like moving to another desk. If I need the terminal for a quick command, I do Ctrl-Z.
- Izkata 2y agoI've only used tiling window managers for over a decade, so for me screen is only for detaching, vim usually only one file at a time, and the window manager lets me tile/stack those and the web browser, zoom, etc.
- lelanthran 2y ago> vim usually only one file at a time, The big advantage of using a single Vim instance for everything is having all my registers shared. I can copy something into register 'a' from file One.txt, and then paste 'a' into file Twenty.txt. Same with recording macros, command history, etc. If any of those buffers are terminals, then I can use them just like a read-only file: copy from them into registers, run macros within them, etc. The advantage, to me, of using Vim over Tmux, is that that I don't need to remember an additional set of key chords for moving between splits and tabs, and for resizing splits, etc. Using tmux requires additional commands and key chords to memorise. I used to love tmux before vim had `:terminal`, but since Vim got `:terminal` there's nothing I get from tmux that I don't get in a simpler and easier way from Vim.
- SoftTalker 2y agoYes very much. You don't need to be an expert. Just knowing how to detach from a running tmux and reattach later, and knowing how to create and navigate between tmux windows and panes is most of what you need to know.
- ProfessorZoom 2y agobad for energy? sir i code typescript in tmux
- kshmir 2y agoYou’ll need gpu acceleration
- echelon 2y agoIt figures that a fancy terminal emulator developer would take issue with tmux. Tmux undoes all the fancy performance end ergonomic stuff they spent their time and energy developing. Moving stuff to the GPU, multithreading, etc. -- all just to call tmux anyway and lose 100% of those features! What we really need is a protocol for tmux (or other terminal multiplexers) to expose its internal state to native terminal emulators so that you can get the best of both worlds. That's a tremendous amount of work, though.
- deleted 2y ago[deleted]
- lexlash 2y agoLike `tmux -CC` and iTerm2? https://iterm2.com/documentation-tmux-integration.html https://iterm2.com/documentation-tmux-integration.html
- dymk 2y agoas far as I'm aware, there is some sort of protocol for looking at tmux state. iTerm has tmux integration, and will show tabs/splits as native (sub)windows. https://iterm2.com/documentation-tmux-integration.html https://iterm2.com/documentation-tmux-integration.html https://github.com/tmux/tmux/wiki/Control-Mode https://github.com/tmux/tmux/wiki/Control-Mode The downside is it doesn't work very well. Tmux tabs open as new iTerm windows instead of tabs, there are resizing bugs, etc.
- deleted 2y ago[deleted]
- SoftTalker 2y agoLove tmux. I don't find myself splitting one window into panes very often, but I certainly use multiple "tabs" (windows) in a tmux session. I keep a tmux session running on my work computer, which has logins to all my commonly needed systems. I can ssh in from home (or anywhere), attach to that tmux session, and instantly have everything I need.
- noloblo 2y agohow do you attach to a tmux session via ssh?
- n_jd 2y agoYou SSH in and run `tmux attach`
- praptak 2y agossh -t -A yourhost.com "tmux attach -d"
- CaptainOfCoit 2y agoOther answers tell you how to attach, but vital missing piece is that beforehand, don't "quit"/"exit" the session but "detach" from it instead, so you can attach later. By default the command is $PREFIX + D
- bpanon 2y agotmux a
- j2kun 2y ago> remote persistence This is the real reason I actually need tmux. I often lose connection to a server for various reasons and don't want to lose my vim session or whatever
- adtac 2y agotmux over mosh over wireguard is all you need
- pessimizer 2y agoI've literally had projects running from screen sessions for years. I always assumed the purpose of them was so I could turn off my computer while doing something over the network that was either long-lived, on an unstable connection, or a daemon/server of some sort.
- tonetheman 2y ago[dead]
- amouat 2y agoJust wanted to say that I appreciate how well written this is. It does make a difference when an author can clearly and succinctly state their case.
- hiAndrewQuinn 2y agoThanks!
- PUSH_AX 2y agoI would be lost without tmux, if you have a regular ssh date with some machine it’s a life saver.
- jrockway 2y agoI agree with all of this completely. I also run Windows as my host OS and do all my work in Linux. I don't use X, I ssh into the Linux VM and have Emacs alongside a bunch of shells running in tmux. It is very productive and even when I have a physical Linux machine, I just start up X, maximize a terminal, and use tmux. The author of Kitty is also right about performance. I've never looked into exactly where the problem is, but tmux <- ssh <- windows terminal is very very very slow. This is most annoying when some program starts printing a ton of stuff and your control C keypress is ignored for a good 15 seconds. While this Should Not Be, I can live with it for the other gains. I do a lot of pair programming with people, and I've never seen a better or more productive setup than this one.
- bombela 2y agoWhat is the advantage/use of Windows compared to some Linux desktop in your setup?
- hiAndrewQuinn 2y agoOP here: Keeps me corporate-friendly, mostly. Half my life is lived in the terminal and the other half is lived in the Microsoft Office suite, and the second half is what really pays the bills for now. C'est la vie.
- jrockway 2y agoFor me it's because I game and don't want: a) 2 separate machines b) To get banned for running the games in a Windows VM Work is a Microsoft place, but honestly the web version of Outlook works great under Linux. Teams is usable. (My Linux friends complain that it sucks, but what they don't know is that it also sucks on Windows!)
- skydhash 2y agoI do the macOS/Linux VM combo. It's mostly that macOS is good for standard use. The hardware is nice, the apps are useful, etc. My VM is for development purpose. It's Debian and I3. I can have a VM for each project and I can suspend them when switching. Due to complexity of software projects and tooling conflicts, it's better to keep each project in its own space. I'd do the same if I was on Linux Desktop.
- kelnos 2y agoI feel like "parsing each keystroke twice" is pretty low on the list of things that wastes CPU cycles and drains my laptop battery. I cannot at all get worked up over this, getting to the point I'd pull out the word "poison" to describe it. It's nice that Kitty does most of what tmux does built in, but as the author points out, that's not really all that helpful for anyone who does any work over ssh. And to me, bundling all that into a terminal emulator is bloat. Terminals should be terminals. If I want a multiplexer on top of that, I will... use a multiplexer on top of that. I am potentially sympathetic to the idea that tmux and screen make it harder for terminal developers to add new features to their terminals. I don't really know enough about the issues involved to form an opinion. But from the perspective of a regular user, I do not want a multiplexer in my terminal app. When I need one, I prefer to reach for an app-agnostic multiplexer like tmux or screen.
- colordrops 2y agoAgree with all your points. The main problem with Tmux that no one talks about is its arcane configuration and interaction patterns. If you set up a ton of config while gritting your teeth, it begins to work well, but the configuration semantics are a nightmare. I would love something similar to tmux that has sane configuration and theming. I switched from XMonad to i3 for the same reason.
- iiio8 2y ago[dead]
- usrbinbash 2y agoSure, but how often do you need to touch that config? Since I keep my configs in a repo, I just checked the last time I changed my `.tmux.conf`. Turns out it was 2018, and I changed a grand total of 2 lines. And I use tmux daily, not just remote, but also on my local machine. So yeah, if I am using something for more than half a decade without requiring any change, then its pretty safe to say that whatever hassles the configuration of that something imposes, is completely irrelevant.
- jonathanrmumm 2y agowhy not just say "less is better?"
- kelnos 2y agoBecause that's not the common, generally accepted term.
- smcameron 2y agoBecause "Worse is Better" entered the lexicon circa 1991. https://en.wikipedia.org/wiki/Worse_is_better https://en.wikipedia.org/wiki/Worse_is_better
- jonathanrmumm 2y agoyes, why? seems like not that useful of a phrase if it needs an explanation with parenthesis in a wikipedia
- nicklaf 2y agoThe phrase was made famous in an influential essay[0] by Richard P. Gabriel, where he laments Lisp's relative failure to compete with Unix. In Gabriel's opinion, Unix proved to follow the more adaptive design strategy in certain ways (in spite of his involvement with and admiration for Lisp), and the phrase "Worse is better" is meant to capture the essence of that advantageous strategy (as outlined in the essay). The essay is worth reading and is a bit more elaborate than just saying "less is more", or "keep it simple, stupid". [0] https://dreamsongs.com/WorseIsBetter.html https://dreamsongs.com/WorseIsBetter.html
- jonathanrmumm 2y agoAh so it’s more “if it’s not broken enough, don’t fix it”
- simonmic 2y ago
- neilv 2y agoI once half-seriously leaned on the lightweight possibilities of reattachable SSH sessions, for a very-very simple way of running/monitoring/futzing a simple server process, when you don't need a big enterprise deployment and observability platform. https://www.neilvandyke.org/racket/rackonsole/ https://www.neilvandyke.org/racket/rackonsole/
- chasil 2y ago>every byte has to be parsed twice, once by the middleman and once by the terminal. The ~ (tilde) codes in OpenSSH imply that it also performs minimal parsing. Particularly, "(return)~." to terminate a locked session. The tmux program is invaluable to me when I have a long-running set of interactive commands, and I want them to survive a network disconnect. There may be valid criticisms of tmux, but wow is it good at this particular thing.
- KolmogorovComp 2y agoThe only annoying thing with tmux are recursive sessions. By that I mean when you run tmux on your laptop, then ssh to your server and start another tmux session there. It is suddenly confusing and you then have to escape commands depending on which session you want to interact with. I’ve been using screen at first remotely for those cases, but eventually bailed out and used my graphical multiplexer locally instead of tmux, or not using tmux remotely when already using it locally.
- ehsankia 2y agoTo me, the only annoying thing with tmux is copy/pasting across different setups and how inconsistent / flaky / tricky it is to get working.
- thanatos519 2y agoI use different escape keys for my local and remote sessions and after many years I don't get confused anymore.
- devsda 2y agoI do the same for one-off tasks. I use ^a as the escape key locally and leave the remote server(s) to use the default ^b because I might need to login to random servers with no shared home or login as a common user and they often have restrictions on adding/changing custom dot files. If it gets too annoying, the remote session is openend in a new terminal tab and I temporarily remap the escape key to ^a on remote tmux.
- tetris11 2y agoThis very much so. I wish there was some kind of SSH "passthrough" that allowed a tmux session on remote to attach to a tmux local.
- jwr 2y agoI made this somewhat less confusing for myself by defining keyboard shortcuts in my Terminal app (MacOS) and using those for switching between tmux screens. E.g. command-n and command-p switch to next and previous locally, while shift-command-n and shift-command-p switch next and previous in a nested remote tmux session.
- tombert 2y ago> but its fundamental value add to any programmer who has to SSH into servers more than once a week is it allows you to split your screen up into multiple independent shells without needing a graphical environment at all. I actually think that value add for SSH is that people is the ability to allow long-running jobs to survive a disconnection. It can be frustrating doing something that takes multiple hours (like a large wget download) just to have your connection break about ten minutes before it's done. Even if you never use any of the other features you immediately benefit from that.
- yaur 2y agoDoesn’t ^z and bg solve this?
- adw 2y agoNot really - often what I’m doing is running something with a conditional breakpoint which will only be hit a long way into process lifetime (potentially nondeterministically), so I really do need “a session which will persist indefinitely including across SSH sessions”.
- tombert 2y agoYep, if you remember to do that. What's nice about tmux is that this happens automatically. It requires zero additional mental forethought outside of typing tmux exactly once, and then all your jobs are safe, and you can still see them in the foreground.
- duskwuff 2y agoNo, it doesn't. There's no way to reattach to a process which was backgrounded and detached in another terminal -- once the parent terminal is gone, the process is stuck in the background. Most interactive processes will terminate immediately when this happens.
- akira2501 2y agoSIGHUP
- 2y ago
- tedunangst 2y agoSome time ago I reported an energy wasting bug in tmux, and surprise twist, it was not the result of parsing every byte twice.
- eigenvalue 2y agoI, for one, love tmux. But I hate it with the stock settings on a fresh machine. Having to use keyboard shortcuts to switch between windows is especially annoying. I have this in an ansible playbook I run on all new machines to set tmux up nicely (I also use ohmyzsh and atuin, but that’s another story): - name: Install custom tmux configuration become: yes become_user: ubuntu git: repo: https://github.com/gpakosz/.tmux.git dest: /home/ubuntu/.tmux/ - name: Set up custom tmux configuration become: yes become_user: ubuntu shell: | cd /home/ubuntu/ ln -s -f .tmux/.tmux.conf cp .tmux/.tmux.conf.local . - name: Set up further tmux customizations become: yes become_user: ubuntu blockinfile: path: "/home/ubuntu/.tmux.conf.local" insertafter: "# EOF" block: | set-option -g default-shell $SHELL set -g mouse on set-option -g history-limit 25000 set -g @plugin 'tmux-plugins/tmux-resurrect'
- bee_rider 2y ago> Kovid Goyal, developer of the ePub powerhouse calibre and my current teminal emulator of choice Kitty, has gone on record a number of times saying he is not a fan of tmux. He has a whole section in his FAQ about it: >> [T]erminal multiplexers are a bad idea, do not use them, if at all possible. kitty contains features that do all of what tmux does, but better, with the exception of remote persistence. Bit funny, most of the time I’m running tmux in kitty (or ssh in kitty to a server with tmux). Remote persistence is a pretty massive deal, though. In general, I don’t like getting attached to a terminal emulator, and mostly just try to avoid using any unique features they’ve got. If a terminal emulator and a command line program are competing for doing a task, the terminal emulator in some sense has an unfairly high hurdle to pass: if I become dependent on the terminal emulator to do it, then I can’t replace the terminal emulator without also getting a new muscle memory for that task, if I ever want to switch terminal emulators. Which means it has to do that task so much better than the command line program that the delta is worth more than any possible improvements from switching terminal emulators. Kitty is a great terminal emulator but this is an absurd and basically unfair bar that it could never pass. In this case, though, it is actually worse than tmux because it can’t offer the best thing terminal multiplexers do: remote persistence, which is the killer feature.
- omoikane 2y agokitty seems to be a relatively more opinionated terminal compared to other terminals. The first time I heard about kitty was via a comment about not implementing Sixel support: https://github.com/kovidgoyal/kitty/issues/2511#issuecomment-609543803 https://github.com/kovidgoyal/kitty/issues/2511#issuecomment... "Terminal multiplexers are a bad idea" sounds just like Sixel being "an inferior graphics protocol", and Sixel is probably another example of "worse is better".
- bee_rider 2y agoI have trouble laying that at the feet of Goyal, who was not really interested in the feature, but who was willing to provide feedback and appeared willing to accept a patch. The person working on the patch decided that they didn’t think the sixel library (which they were the maintainer of, so they presumably had a well informed opinion) was up to the task. The description of sixels as inferior also came from the person working on the patch.
- rmdes 2y agoI'm into byobu because it allows me to choose tmux or screen and I've gotten used to how it handles new "windows" in my terminal, I mostly use it server side, so I can have persistence and have each tab window in the remote terminal running exactly what I want, combined with fish shell it's just a pleasure to work
- INTPenis 2y agoKovid may be right, but from a usability standpoint they're dead wrong. Users will gravitate towards what makes their life simpler, once it was screen and now it's tmux. Regardless of the technicality behind it. I actually gave zellij a try recently but went right back to tmux. Zellij seems like a very promising software but tmux still has a lower threshold of entry.
- sgt 2y agoWhat's wrong with screen? I tried tmux about 15 years ago but didn't really see the major benefit. Has it changed much?
- gitaarik 2y agoYes, it has a bigger more active community with more features and plugins. I used to use screen all the time but then converted to tmux because of modern features that screen didn't support, at that time at least, like displaying certain Unicode characters and a way to restore a previous session. It was a bit of a hassle to make tmux work similar to screen and some things you have to really do in a different way, but overall I'm happy with the switch.
- INTPenis 2y agoI can only speak from personal experience but I never got deeper into screen than running basic commands in a detached screen and re-attaching it. But with tmux the docs and ui were just so intuitive that I was a power user within weeks.
- timonoko 2y agoOnly problem ever was the metacharacter Control-A. We didnt like it, because it messed the workflow in Emacs and Bash.
- nephanth 2y agoImo, the killer feature of tmux is that not only does it persist your shell, it persists your workspace. If I ssh into my server, i'm going to find my whole session as i left it, with the same tabbing / panes. This is a need kitty+screen doesn't answer. If I close kitty & reopen it, i'll have to re-split every individual pane, and reconnect each of them and reattach them to the right persistent screen pts... Infact if there was a way to handle that "workspace-persistence" with terminal emulator-based workspaces, I'd ditch tmux in a minute EDIT: now that i think about it, this could maybe be achieved by keeping the terminal multiplexer's "server", but having the terminal emulator act as a client to it
- cbarrick 2y ago> EDIT: now that i think about it, this could maybe be achieved by keeping the terminal multiplexer's "server", but having the terminal emulator act as a client to it This is exactly what iTerm2 tmux integration does. Tmux exposes a "raw" control mode by starting it with the -C flag. iTerm2 uses this to convert tmux windows into native tabs/windows, complete with workspace persistence. AFAIK, iTerm2 is the only terminal emulator to integrate with -C controle mode, which is probably the main thing that keeps me on macOS over Linux.
- n4s33r 2y agoiterm2 tmux integration is the bees knees - I didn't find anything like it elsewhere.
- Ringz 2y agoRunning Kitty and having stable connections to all my servers means I never needed tmux. That’s the point for me. If you have a stable connection, let it run in a separate tab, window, split—whatever—until it’s finished. Digital life is complex and fragmented enough, so I avoid having to deal with another layer like tmux and call it a day. Keep it simple.
- kibwen 2y agoBut if I hibernate my computer twice a day, once to take it to work and once to bring it home, then twice a day my SSH connection will be killed due to hibernation (or even if I didn't hibernate it, it would be killed during network disconnection), meaning this setup is only good if everything I do fits into a single eight-hour workday, or if I work exclusively over a cellular connection with transparent network migration and never put my computer to sleep. Simpler to just have a program running on the server that I can attach to.
- Ringz 2y agoI know what you mean, but again, I never need that and the investment in tmux is to high for edge cases. Btw: Long running jobs are easy with a cron job: echo "/path/to/long_process.sh" | at now + 1 minute
- gitaarik 2y agoYou never let your PC sleep when you're having lunch or something?
- Ringz 2y agoI do. No Problem closing the lid on my MacBook M1. I can open the lid and keep on working where I left. I use kitty and the kitten ssh [1] to login easily to remote hosts, and automatically setup the environment. I can use a simple bash like #!/bin/bash kitty @ launch --type=tab --title='Server 1' bash -c "command1; exec bash" kitty @ launch --type=tab --title='Server 2' bash -c "command2; exec bash" kitty @ launch --type=tab --title='Server 3' bash -c "command3; exec bash" If I need several servers at once. Could be done with other shells too. I can run loooong processes on the host with a simple bash script and the marvelous `àt` [2] command that nobody seems to know any more like: echo "/path/to/long_process.sh" | at now + 1 minute And the team can reuse those simple bash scripts! If `at` is not installed, and you need to run multiple looong tasks, try `nohup` [3]. Another lost command full of great functions like: nohup command1 & nohup command2 & nohup command3 & If you and your team is happy with tmux, that's fine! But doing more or less the same things with easy linux commands is – in my opinion – the better way. [1]: https://sw.kovidgoyal.net/kitty/kittens/ssh/ https://sw.kovidgoyal.net/kitty/kittens/ssh/ [2]: https://linuxhandbook.com/at-command/ https://linuxhandbook.com/at-command/ [3]: https://www.howtogeek.com/804823/nohup-command-linux/ https://www.howtogeek.com/804823/nohup-command-linux/ and https://stackoverflow.com/questions/5164985/how-can-i-use-nohup-to-run-process-as-a-background-process-in-linux https://stackoverflow.com/questions/5164985/how-can-i-use-no... Edit: Formatting
- swapsCAPS 2y agoheh I notice I really don’t care what any of the terminal emulators provide in terms (get it) of functionality. iTerm2 now has “AI”. What? As long as I have my good ol trusty tmux setup I’m good. Since the multiplexer _is_ the middleman it has become the perfect place to implement functionality which would otherwise be emulator specific.
- leblancfg 2y agoFor me kitty’s main upside is its configuration dotfile that can be version controlled. I used iTerm2 for years, but moving around multiple computers makes it harder.
- hiAndrewQuinn 2y agoOP here: I'm realizing tmux's/screen's remote persistence is a bigger deal for a lot of commenting folks than my dinky little "how do I put my logs on the right and my vim on the left" use case. Color me mildly surprised, I always thought screen splitting / multiple shells in tabs was the reason we were all using these. To be unambiguous, that's not the "worse is better" I'm talking about. That's straightforwardly better is better.
- kzrdude 2y agoIf I use a terminal with mosh with tmux with neovim with :term how many parses is that? At least 4 or 5. It works!
- lisper 2y ago> tmux (short for “terminal mux” (short for “multiplexer”)) is i3 for your terminal. What a weird way to describe it. It sounds more like an alternative to gnu screen [1] to me. Comparing either of those to i3 seems like a category error to me. --- [1] https://www.gnu.org/software/screen/ https://www.gnu.org/software/screen/
- granra 2y agoFunnily enough I used to use i3 and later sway until I realized I just full screened everything (on different workspaces) except terminals. Now I just use gnome and attach to a long running tmux session where I split panes to replicate my old tiling workflow.
- pratclot 2y agoExactly, this comparison seems like an insult to tmux. I tried i3 because of all the hype (and lack of sensible arguments to use it), and in an hour realized that it forces me to manage things I did not need to even think about on a normal system. Also, it did not improve my productivity, it slowed me down trying to figure out how to manage my windows. Tmux is great because its features work out of the box without a need to customize anything, this is a common trait of a useful and popular software (bash, ssh, coreutils, curl). i3 is not even close to this.
- tambourine_man 2y agoI like tmux and have an extensive tmux.conf that I spend many hours fiddling with. But I end up using the native terminal a lot more. I love smooth scrolling, command key shortcuts and, for whatever reason, colors are a bit off when I log into Debian. These tiny details add up. Vim even has a built in terminal these days, so it’s one less reason. But it’s a nice utility to have in your belt for sure.
- thih9 2y agoWhat I like about tmux is that it in itself runs in a terminal. Its UX - like scrolling, copy pasting, pane management, etc - complements other terminal apps, resulting in a workflow that I find consistent and unobtrusive.
- sumosudo 2y agoHa. I've got two production sites running in tmux. Yeah I know. Crazy. Mad. Foolish. but its worked for years. Of course only two sites though, I swear.
- hiAndrewQuinn 2y ago;) This thread has given me some ideas to toy around with and maybe add to https://andrew-quinn.me/cli/ https://andrew-quinn.me/cli/ , let's say. That feels so wrong... but oh, so right. Who needs systemd when you've got a Pi and tmux?
- thayne 2y agoEven if you ignore persistent sessions, there are some limitations with kitty's remote multiplexing functionality. For example some functionality relies on copying files, including executables, to the remote box, which may not be desirable or even possible. It also uses the ConrolMaster feature of ssh, which has some downsides, such as not being able to add additional port forwarding after the master session is created (at least on older versions of ssh, maybe that is fixed in a more recent version than what I use at work?).
- koinedad 2y agoI’m not tmux master but I love using it to help organize different repos/projects I’m working on and especially when I need to run a long running query on a remote server it’s a lifesaver. I made an intro video for my setup here if anyone is interested: My Simple Tmux Workflow https://youtu.be/hC5-j30olKc https://youtu.be/hC5-j30olKc
- anthk 2y agotmux attach >>>> kitty That's it. Even with mosh it's useful. On latency witth escape codes and issues with vim/vis, set this at ~/.tmux.conf: set -g escape-time 10
- deleted 2y ago[deleted]
- vegabook 2y agoThis geez wants to lock us into Kitty vs cross-terminal TMUX? ... and withouth attach/detach?? Even a 386 running at 20 Mhz can trivially handle Tmux what's this whole "oh it has to parse keystrokes twice" malarkey?
- gavinhoward 2y agoMy perspective: https://gavinhoward.com/2022/02/goodbye-kitty/ https://gavinhoward.com/2022/02/goodbye-kitty/ . tl;dr: tmux has saved my work many times, and Kitty affordances do not make up for that. And it's an integral part of my dev environment: https://gavinhoward.com/2020/12/my-development-environment-and-how-i-got-there/ https://gavinhoward.com/2020/12/my-development-environment-a... . As an update, I'm on Alacritty.
- wazoox 2y agoI go even farther: I often use tmux in screen or the reverse. For instance I'll open a terminal (generally rxvt), then run screen locally, and from within screen connect to various machines on which I'll run tmux (because I almost always want to run long running programs remotely, even if only 'apt upgrade '). And I'm not even ashamed
- quocanh 2y agoAn alternative: `zellij` is better is better. With `tmux` I never get the sense that I have "mastered" it. I simply don't know all the controls - I only have a few of my most commonly used ones. Stepping into `zellij`, I feel like I've mastered it within a few hours of using it.
- aerzen 2y agoI've been using tmux for some time now and have gotten pretty good with it, but the other day I got fed up with small problems of copy mode and how it displays tabs, so i tried zellij. First impression: way too much visual clutter. Second, way too many key bindings I don't need. And one configuration file later: a perfect replacement for tmux, with just the right amount of features for me.
- dpc_01234 2y agoI'm offput by the visual clutter myself. Please share the config to get over it.
- zokier 2y agoHuge swathes of terminal ecosystem falls into worse is better. Implementing terminal emulator in terminal is just on-par here. You can make all sorts of interesting arguments between the options, but ultimately there are no "good" choices here, its all more or less worse.
- kanodiaashu 2y agoI ssh from a mac into linux servers for my everyday work. I went from tmux + vim TO (doom) emacs + tramp + projectile. I think I outgrew vim, and emacs EVIL gave me VIM but also magit and org and projectile. I tried to work in the emacs shell for a while. I realised I need tmux persistence still. Emacs shell also just doesn't do well with EVIL mode. So now I just do all development on emacs and manage runs etc through my tmux, occasionally still using vim on the tmux to manage config files when I don't want to load them into emacs because its a one off. I dk about kitty, but I'm a fan of Kovid Goyal's calibre. I can't imagine how I would live without a. multiplexing b.persistence c.returning me to my context. And I never have had any tmux problems.
- coxley 2y agoLike some others in the thread, I started using Zellij last year and boy is it nice.
- KennyBlanken 2y ago> Energy/performance wise they are poison, every byte has to be parsed twice, once by the middleman and once by the terminal I get that software bloat is a problem, but it's a little strange to hear a man whine about the overhead of a byte getting parsed twice as part of a terminal session when ten years ago desktop computers had around 8-9GB/sec memory bandwidth and single-thread performance measured in multiple billions of operations per second... ...when he refuses to split out highly dynamic functions (the news parsers) of Calibre into a plugin so that he doesn't have to version-bump Calibre every time a newspaper slightly changes their website and breaks the parser, forcing tens of thousands of users to update the entire package (and he doesn't implement a self-updater, much less one with binary diff capability.)
- aumerle 2y ago[flagged]
- deleted 2y ago[deleted]
- kashyapc 2y agoThe linked FAQ in the article says: "terminal multiplexers are a bad idea, do not use them, if at all possible". This sounds like the author seems to ignore the ground reality. For the vast majority of users, tmux simply does its job and gets out of the way. They (we) don't even notice these subtle issues. It's simply a non-issue. Stuffing the entire multiplexer into a new terminal emulator sounds like a solution in search of a (specialized) problem. Not just that, you now have two problems: first, you have to learn the new terminal emulator; then, get to the built-in multiplexer with its own quirks. The classic cliché of "do one thing and do it well" applies here.
- EasyMark 2y agotmux works well and I can prettify it. I don't care if it's the most pure or performant. It's plenty fast enough for me and I don't ever recall it crashing. I think what matters is results. I love the way it separates terminal functionality and sessions away from gui terminals. if my connection blips it's easy enough to log back in and resume my ssh connection. Functionality is king.
- LAC-Tech 2y agoKitty was the slowest starting terminal I'd ever tried. Noticeable delay when you spawned a new one.
- deanresin 2y ago> Because it’s always going to be there, and it does the one thing I actually need it to no matter what: Let me run multiple shells at once, without SSHing in multiple times, regardless of whatever funky terminal emulator I’m actually using to get the job done. I'm confused. Couldn't you just open a new tab to do this? Or just alias your shhing to a 4 stroke alias like "sshg"?
- camgunz 2y agoI (of course) wanna plug Vim again here. Vim comes with a great terminal, you can arrange the windows however you want, you can save the layouts in your sessions, and the keybindings for doing all of it are real straightforward. I used to use some kind of terminal, some kind of multiplexer, and Vim, but now I just use (Mac)Vim.
- complex_pi 2y agoAs tmux is discussed: my setup is xterm + tmux with 'C-o' as the key binding. Conflicts with nothing I use and allows me to start screen while in tmux (don't ask :-O but sometimes tmux is local and I want a remote screen). The binding is also ok whether you use vi or emacs. What else could you want?
- znpy 2y ago> [T]erminal multiplexers are a bad idea, do not use them, if at all possible. kitty contains features that do all of what tmux does, but better, with the exception of remote persistence. Kitty developer should really ponder on why people use terminal multiplexers in the first place. I do and here is the thing: i can live happily without kitty, but i can’t live without screen (or tmux). Quite frankly i do use mac os built in terminal and it’s fine? I do everything in a screen session anyway. If i want a better terminal emulator i have SecureCRT.
- andrewaylett 2y agoIn your `~/.ssh/config`, make sure you have: Host * ControlMaster auto ControlPath ~/.ssh/control/%C.sock ControlPersist 300s And SSH will multiplex as many sessions as you want into a single connection. If you're not using tmux to allow you to resume detached session, this works really nicely. I have fingerprint auth for the first session, to establish the connection, then I can connect and disconnect to my heart's content without authenticating again unless I have no connections open for 300s. I typically use plain SSH with persistent sessions, and connect over Tailscale so even if I go offline and reappear on a different IP address my session will probably survive. If my session doesn't survive, it's easy enough to start a new one :). The missing piece, from what others have commented about, is long-running commands. If I'm upgrading Debian over SSH then I will do that in `screen`, but for pretty much anything else I'd prefer to launch it as a (possibly ad-hoc) service and let my service manager look after it.
- erik_seaberg 2y agoI nohup anything slow that isn't interactive, it's POSIX and the logged output might be useful if it dies halfway.
- idatum 2y agoFor remote SSH, I like to use an .ssh/config setting for the remote host and automatically start a remote tmux. Saved my work a few times from spotty connections from my laptop tethered to my phone. Something like this: Host t-sdf HostName sdf.org User idatum RemoteCommand tmux new -A -s mylaptop RequestTTY yes Then log in with ssh t-sdf and tmux is happily running a session named "mylaptop". Connecting again gets you back to the same tmux session. I use tmux daily and I haven't found a reason to switch.
- Repulsion9513 2y ago> > [Terminal m]ultiplexers add unnecessary overhead, suffer from a complexity cascade, because they actually have to translate escape codes, modifying them in hackish ways to get them to work with their concepts of windows/sessions. […] So... like how a terminal emulator translates escape codes, modifying them in hackish ways to get them to work with X's/Wayland's/users' concepts of windows/sessions? :) Obviously that's not an apples to apples comparison but really, while that may make it more complex and slightly buggier I don't see how that makes it bad. > I find myself typing out “tmux” as the first command I run. Because it’s always going to be there, and it does the one thing I actually need it to no matter what: Let me run multiple shells at once, without SSHing in multiple times I don't understand why people hate opening up another SSH session. If you're really worried about the 10 seconds it might take, you can easily configure it to take more like 1: -M Places the ssh client into “master” mode for connection shar‐ ing. Multiple -M options places ssh into “master” mode but with confirmation required using ssh-askpass(1) before each op‐ eration that changes the multiplexing state (e.g. opening a new session). Refer to the description of ControlMaster in ssh_config(5) for details. The only reason I ever use screen is for persistence, the multi-windows is just a secondary feature. (Since when is tmux "always going to be there"?)
- gitaarik 2y ago> I don't understand why people hate opening up another SSH session. If you're really worried about the 10 seconds it might take, you can easily configure it to take more like 1: Well, for one example, when you have an SSH key with a passphrase, you need to enter the passphrase at the start of every new SSH connection. If you are working with multiple servers continuously and lose your SSH sessions when your PC goes to sleep, it's quite nice to have tmux.
- em-bee 2y agoi am usually to lazy to replace the default terminal. most of the time i did that i found some problem that gnome terminal didn't have. rarely i found features that i wanted in other terminals. but occasionally i get curious, so lets try this: 1: ugh, the theme is dark. gnome-terminal also starts with a dark theme. i go into settings to change that. there doesn't seem to be a settings gui so let's look at the documentation. no mention of switching themes there. a search online reveals that i need to run "kitten themes". there are tons. the day theme looks good to start with. 2: font is to small. ctrl-shift-+ helps. i don't frequently open new terminals so this is good enough for now. 3: attach my already running tmux session. (sorry but i use tmux for the one thing that kitty doesn't support: persistence). works. no problem there. 4: next up: connect to a distrobox container where i do dev work. no support for xterm-kitty terminal type. reset $TERM to xterm-256color, phew. now it works. 5: open new tabs. manpage has a nice table of the necessary shortcuts. i like ctrl-tab because i can do it with one hand. 6: let's look at my email (sup-mua runs in a terminal). oh there is a problem with the colors. the status bar is hard to read. let's try another theme. adawaita shows the list white on white? huh? ok, CLRS seems reasonable. github theme looked better, but the fish terminal colors were to bright, especially the git commands. ironic. 7: faded tabs look ugly. tab_bar_style powerline looks better. i think that's it for now. hopefully i don't have to spend more time with configuration. i am not really a fan of having to fiddle around to much to get things working.
- _blz2 2y agoZellij is an order of magnitude better than tmux. Main issue with tmux was that it always messed up my TERM.
- jacknews 2y ago> ctrl-b % ctrl-b " I thought everyone mapped it to ctrl-a Then I have mapped | and - to split screen horizontally and vertically
- hiAndrewQuinn 2y agoI try to remap my programs' keybindings as little as possible, as a general rule. Sometimes if I see an advantage that's both big and obvious, I'll take the plunge and remap. Like as a teenager when I realized switching to Bumper Jumper in Halo 3 would make me much better with aerials, because I could turn and jump simultaneously. Otherwise the annoyance of having to relearn the command bindings any time I'm not at one of my preferred interfaces just doesn't feel worth it. That being said, I did recently get one of those fancy split keyboards which lets you remap the keys. Ctrl is something I trigger with my thumb now, not pinky, and so C-b feels as natural as C-a would at a normal laptop keyboard.
- jacknews 2y agook that makes sense, I have caps-lock mapped to ctrl, so ctrl-a is the obvious mapping for me.
- timonoko 2y agoTmux got a new life, because you cannot have several terminal screens in Termux (of Android). Screen was not good, because Control-A is important in both Emacs and Bash.
- gitaarik 2y agoOne of the things I like most about tmux is the scrollback buffer, which you can scroll through and search and copy/paste any text in the shell output with vim-like keybindings (you have to configure it for vim-like keybindings, otherwise it's emacs style). It makes my workflow very efficient. I haven't found a terminal emulator with such convenient features and keybindings. And searching, copying and pasting are things that I do a lot in my terminal.