14 ms·
Getting Started with Tmux
- idatum 4y agoFor Windows users: Install Windows Terminal and enable WSL. WSL or WSL2 are both fine (I use both). I have like 10 tmux sessions going in 2 or 3 tabs. It's a whole new level of CLI on a Windows box. Loving it.
- petepete 4y agoI've been using tmux daily for more than a decade and didn't know prefix+! converted a pane to a new window.
- blueflow 4y agoI recommend to everyone, if you are using a tool regularly, take half an hour of time to study its man page. This way you'll learn about all the things that your tool supports but you haven't been aware of yet.
- sophacles 4y agoI agree, and would like to add: do this once in a while with all your tools, even ones you have read the manpage for. Even ones you have a high level of proficiency in... New features get added that you might miss. When you first read the manual there's a good chance you either missed something or didn't understand how cool feature xyz is (e.g. because it's a feature that only makes sense once you are proficient with the basics).
- koinedad 4y agoI’ve been using it for years as well and had the exact same thought!
- fartcanister 4y agoGreat crib article. Would be nice to adapt the webpage for mobile screens a little bit better.
- whatbackup 4y agoDone. Thanks for the feedback. Desktop simulation didn't catch that.
- azemetre 4y agoI've only used tmux for about <year now but I immensely enjoy it. One of my favorite scripts to run is a tmux script that creates a new session with about 7 windows of running my company's project (one window for notes, 3 windows for the backend (runner, code, tests), and 3 windows for the client (runner, code, tests). It's even tweaked further to open up the code in vim, and when used in conjunction with something like harpoon.nvim I have access to my most used files with a few keystrokes. I now create similar scripts for all projects I work on for lengthy periods. One script builds and runs the environment in the way I prefer to work. Tailored to my taste, for me. Probably the best advice that I always took to heart was a co worker telling me to "just learn the command line." He really took the phrase "learn your tools" seriously. Now, after some decent experience, I finally feel like I have a decent box of specialty tools when heading to any job site.
- kzrdude 4y agoAnd just like learn your tools, also “make your tools”. This is what we do all the time. This is why we compare ourselves with craftspeople. We have in common that working on the craft includes improving and making your own tools to get the best result.
- azemetre 4y agoYes! I'm slowly moving towards these steps, it's my excuse for learning go and rust. There are some CLTs that don't exist for my need and I'm working towards creating them. I don't know if you've heard of charmbracelet [1] but they are a company that makes a lot of cool go libraries to assist creating CLTs and TUIs. One of which was on HN recently, VHS [2]. [1] https://github.com/charmbracelet https://github.com/charmbracelet [2] https://github.com/charmbracelet/vhs https://github.com/charmbracelet/vhs
- ghoward 4y agoI do this too! [1] It's amazing how well tmux works as a project setup tool. [1]: https://gavinhoward.com/2020/12/my-development-environment-and-how-i-got-there/ https://gavinhoward.com/2020/12/my-development-environment-a...
- blackbear_ 4y agoI like tmux a lot more once I started using ` as prefix
- cyberpunk 4y agoThere are dozens of us! Dozens! :}
- flagsrule 4y agoThe only extra thing I want from tmux is to persist sessions across reboots and shutdowns. I found a plugin called tmux-resurrect but it would be nice as a base feature.
- capableweb 4y agoI use https://github.com/tmuxinator/tmuxinator https://github.com/tmuxinator/tmuxinator for my workspaces. Doesn't save ad-hoc layouts, but usually I find one layout that works per project, then create a tmuxinator config for it, so after reboot, it's a short "tmuxinator start $my-project" away to get back to how I want it to be.
- crucialfelix 4y agohttps://tmuxp.git-pull.com/ https://tmuxp.git-pull.com/ does the same thing, but I think it's smoother to work with. It does support freezing current panes. yaml config
- alchemist1e9 4y agoAs a heavy GNU Screen user for the last 2 decades it’s always in the back of my mind if I should be switching to tmux. Maybe there is a compatibility mode. For those who switched from screen what was the biggest benefit?
- kevstev 4y agoFor me it was that tmux worked out of the box the way I spent many hours getting screen to work the way I wanted. And then from there, just in general the docs were better, it was updated more often, and in general was a bit less obscure in how it was configured.
- blueflow 4y agotmux can't do anything related to real serial lines. And if you do launch tmux via serial line, tmux is hard-coded to disable software flow control. Its basically for utf8-capable terminal emulators only.
- victorquinn 4y agoI wrote a decent amount about that here https://www.victorquinn.com/tmux-tutorial https://www.victorquinn.com/tmux-tutorial tl;dr tmux has much easier configuration, it is more actively developed and maintained, and now (this isn't in my post) a richer add-on/plugin ecosystem
- pridkett 4y agoThis was me. At first it was just like “Hey, prefix is C-b instead of a C-a, so it messes with less” (i.e readline, emacs), then I started to understand the windowing better and it feels a bit more natural with modern terminal emulators. And yes, I know the prefix can be changed. Overall, I’m still comfortable switching back and forth, but it seems like tmux is the new hotness, so I’m using that most of the time. It’s a bit easier to style, etc.
- ledauphin 4y agoi switched a long time ago after one too many weird screen bugs, and i've never looked back. at this point i couldn't say why it's better, but you won't regret switching unless you regularly find yourself using boxes without screen.
- victorquinn 4y agoOh hey there, I wrote a whole book with the same title of this post. Love to see more tmux love! If you dig this and want a whole book that goes into more depth, check out Getting Started with tmux (the book, not the ittavern.com blog post :P) https://gettingstartedwithtmux.com/ https://gettingstartedwithtmux.com/
- sodapopcan 4y agoTmux becomes more awesome when you use something like Alacritty or Kitty [EDIT: scratch Kitty, this mainly applies to Alacritty] and map your system's key (Apple's command key or... whatever it would be on Linux or Windows) and use that as your "tmux key". That way you can make single-chord bindings for all things tmux and life becomes better. If you use Vim, adding VimTmuxNavigator[0] improves things so much. For example, to seemlessly switch between panes, be they tmux panes or vim panes, I use `cmd-h`, `cmh-j`, `cmd-k`, `cmd-l`. It's possible to achieve "command as tmux key" with iTerm which I did do for years but I don't recommend it. It's very hacky. [0] https://github.com/christoomey/vim-tmux-navigator https://github.com/christoomey/vim-tmux-navigator
- Scene_Cast2 4y agoI'm personally a fan of byobu - it moves the shortcuts to function keys.
- sodapopcan 4y agoByoby looks good, though I never use function keys. I like to keep (almost) everything as close to the homerow as possible, so I don't think I'll ever abandon tmux. For example, to jump to specific windows within a tab, instead of number keys, I use `cmd-a`, `cmd-s`, `cmd-d`, `cmd-f`, `cmd-q`, `cmd-w`, `cmd-e`, and `cmd-r` for windows 1-8 respectively (I don't have one for 9 since if I ever get past 8 windows, they are usually throwaways).
- trasz2 4y agoThe main reason for having function keys is that you can have their labels on the screen, and that's intuitive. You can see it with IBM's CICS. Otherwise they are not that useful, and you can see it in eg laptops making Fn a secondary function, with the primary being adjustment of brightness or volume.
- sodapopcan 4y agoOh ya, I'm not against function keys or anything, just not for me. Switching to vim 10+ years ago made all my RSI problems go away so now I just like to keep my fingers on the letter keys as much as possible. I don't even like stretching to number row when I can avoid it (though I do all the time, of course).
- jbj 4y agoMy favorite mod is something simple as renumbering the windows/tabs to range starting at 1, rather than being zero indexed, this way they align with the digits on my keyboard.
- hardware2win 4y agoTmux made my first months with linux on server way easier Great tool I just wish that eg windows' (os) terminal was smarter when you have eg two windows in tmux next to eachother and try to select line or text with mouse then it was just selecting from one window, not many or all
- dwagnerkc 4y agoI would add Prefix + z for temporarily maximizing/minimizing pane to the full windows is very useful. Config doesn't have to be very complicated, I've used this for a while. set -g mouse on # allow mouse set -g history-limit 999999999 # unlimited history set -sg escape-time 0 # vim esc response faster
- elektrontamer 4y agoOne of the best software I've ever used, it's addictive. Did anyone manage to get it set up on windows? And if you did is it buggy or does it run smooth?
- farrelle25 4y agoI use TMUX all the time inside Gitbash for Windows. Some panes are SSH sessions into Linux servers etc. While other panes I use vim to edit local Windows txt files or just run other local Windows things. (This mightn't be what you were looking for)
- elektrontamer 4y agoIf I could get that in cmd and powershell it would be perfect. I have to use cmd at work. I use gitbash for other stuff like you do but cmd is where I really need tmux.
- taude 4y agoI used to use TMUX user, back in the days when I could SSH to servers. Now days, using a containorized stack (K8s) with cloud native deployment infra/tooling, cli's for accessing the remote resources, rigid access restrictions, etc. I found that I was only using it for managing multiple windows/panes for my local tooling. And have simplified my setup to just doing that inside local Terminal software (iTerm for me right now). (No more configuring copy/paste, scrolling buffers, custom key-bindings so they don't interfere with other emacs, shell bindings, configuring the prefix binding because hitting ctrl-b before each command is annoying, etc.). I used to also use tmux resurrect to persist between sessions, etc. but it often failed me as much as remembered where I left off. My TL;DR: sure, use Tmux if you're directly accessing remote resources often, otherwise there's probably simpler solutions that might get you 95% of the way there.
- digitalsushi 4y agoMy favorite antipattern is, you can just leave a script that does an event loop running in the foreground, detatch tmux, and voila, you have a 'server'. Works great in a pinch or when you just don't need to finish it.
- lolive 4y ago+1 Been running my servers this way, for years.
- simplerhosting 4y agoI've only recently started running my servers this way, and I've taken this to the next level with bubblewrap: https://tobykurien.com/simpler-linux-selfhosting/ https://tobykurien.com/simpler-linux-selfhosting/
- lolive 4y agoNice! From my experience, really what you want next is a working tmux-resurrect. Or, at least, all your services runners to be in .sh scripts (and not just in your so evanescant bash history)
- chrisweekly 4y agoHmm, "evanescant" seems wrong... sure enough, that's an obscure Latin word, vs intended "evanescent" (~synonymous w/ "ephemeral", ie soon-disappearing). PS comment is in spirit of knowlege-sharing not pedantry. :)
- lolive 4y agoTrue. [to be limpid, I just meant that a reboot could kill that server-in-tmux strategy ;P ]
- simplerhosting 4y ago
- wildrhythms 4y agoI use iTerm locally and tmux on a dev instance and it's great. The built-in tmux integration[1] is a pleasure to use. On my end, I see a terminal with tabs; if my ssh connection drops, I can just reconnect and magically all the tabs and their states are persisted. In lieu of this integration, I enable the tmux mouse mode which lets me highlight text with the mouse, navigate around splits by clicking in them... great piece of software :) [1] https://iterm2.com/documentation-tmux-integration.html https://iterm2.com/documentation-tmux-integration.html
- ledauphin 4y agodoes the integration work fully with tmux key commands?
- saagarjha 4y agoThe best way to use tmux is with -CC, which iTerm maps to native UI. tmux tabs and panes become native tabs and panes and your session is immortal, and it’s a far better experience than mosh or whatever the latest thing in this area is. I have never bothered to figure out how the keybindings actually work and I probably never will, but I enjoy using it all the time because of this.
- ledauphin 4y agodoes all of this work with the tmux keyboard shortcuts? the main reason I use tmux is to avoid the mouse...
- crucialfelix 4y agoYou use iTerm shortcuts instead. You can customize those as you like. So it feels just like using iTerm, but the panes are running in tmux. The main reason to do this (for me) is to use (tmuxp)[https://tmuxp.git-pull.com https://tmuxp.git-pull.com] to configure window sets for different projects / clients and start them up quickly.
- nrclark 4y agoAgreed 100%. This is iTerm2's killer feature IMO, and it's the only thing that keeps me on a Mac for my work laptop.
- crucialfelix 4y agoThe other great reason to use iTerm to run tmux is that copy and paste work correctly. I started doing this last week along with tmuxp for managing window sets. It works great.
- memco 4y agoI had trouble getting the tmux setup working in iterm. The main page suggests -CC, but the best practices wiki[0] says to use `-CC new -A -s main`, but this causes iterm to warn that a session is already started and doesn't actually create or reattach like I expected. I also had trouble getting the tmux select-layout to work: when I tried it all my panes just exited with an error. I would like to have iterm behave similarly to Kitty's tall layout[1] which I think is the same thing as tmux's main layout, but haven't figured out how to make it work. Anybody have tips on making these wek? [0]: https://gitlab.com/gnachman/iterm2/-/wikis/tmux-Integration-Best-Practices#what-tmux-command-should-i-use https://gitlab.com/gnachman/iterm2/-/wikis/tmux-Integration-... [1]: https://sw.kovidgoyal.net/kitty/layouts/#the-tall-layout https://sw.kovidgoyal.net/kitty/layouts/#the-tall-layout
- lolive 4y agoHint for more advanced users: Tmux inside tmux works not that bad. (Ctrl-B Ctrl-B becoming the prefix for the inner Tmux-es)
- jasone 4y agoEven better IMO is to use different prefixes for outer vs inner tmux sessions. These are the first lines of my .tmux.conf: # Use C-a for outer sessions, and C-x for nested sessions. unbind-key C-b set-option -g prefix C-a bind-key -n C-x send-prefix
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- mindv0rtex 4y agoI recently decided to give terminal multiplexer a try. I first used tmux for a couple of weeks and then discovered zellij. It felt much more user-friendly, but I don't know how much I am missing out in terms of useful features compared to tmux.
- TheCondor 4y agoI like zellij, it has some bugs and seems to leak memory for me. I think it’s a it easier to get configured and set up though. Seems like it might be great one day though.
- cyberpunk 4y agoMy favourite tmux trick only works on an apple gb keyboard: set -g prefix ` bind-key e send-prefix Then, all your tmux controls are one left pinky press away (` is beside z on uk Mac keyboards). (`e sends a ` for when you need it, rare though, $() is better for sub shells :})
- ledauphin 4y agoI use backtick as my prefix as well, plus 1-indexed window numbers. I guess it's a bit farther away than yours, but it's still wonderful.
- hyperhopper 4y agoUnless you already took that mentality to the next step, and put your Esc key where the most people have their backtick key, with the (comparatively rarely used) backtick key on a second layer. But then again those types of users are also likely already hyper aware of hotkey modifications and optimizations.
- cyberpunk 4y agoesc is caps lock (vim user) -- although this has the unfortunate effect of making other devs machines virtually impossible to use since for 20+ years I've used caps-lock-as-escape and it's muscle memory now...
- sundarurfriend 4y agoI've used Tmux/Screen the few times I've had to be in an actual terminal, but don't really see the use for them when using a GUI terminal emulator. I just open new tabs or (rarely) windows as needed. Could anyone using these explain what it provides that you find useful in practice? I rarely ever need persistence of shell when I close the console, is that a common need? Familiarity/muscle memory of shortcuts is a valid answer, but I'm wondering if there's more to it than that.
- ImprovedSilence 4y agoWorking locally: When you want multiple windows configured more compactly or more customization than any gui emulators. But it really shines for remote work where you’re not running a vnc, where u have a persistent terminal session, maintain all windows etc if you get disconnected.
- Gualdrapo 4y agoI use tmux in a GUI terminal emulator (KDE's Konsole) for a force of habit. It's nice to have split views, tabs and sessions, though Konsole offers tabs and splits, but it's nice to have them when you need to go to a TTY and having your session running there too as if nothing had happened.
- Nimitz14 4y agoIn roles like research it happens that one spends tons of time on the command line. It's normal for me to have spent more time in a week running commands in the terminal than writing code.
- BrotherBisquick 4y agoDoesn't it drive you crazy to lose your work whenever X11/Wayland crashes, or you have to kill your display server to diagnose a problem, or you accidentally close a terminal window? tmux preserves everything for you unless you explicitly kill it, or you have to reboot. I started using Screen like 20 years ago (and later moved to tmux) and I can't go back to doing real work in a "bare" terminal window. It would feel like walking on a thin layer of ice on a lake; as soon as something goes wrong, it's a minor disaster.
- rspk 4y agoAmong many tricks and tips, I recommend mapping `|` and `-` to split panes: bind-key | split-window -h bind-key - split-window -v More on my wiki: https://wiki.rsapkf.org/notes/unix/tmux/ https://wiki.rsapkf.org/notes/unix/tmux/
- sodapopcan 4y agoAs an alternative for vertical splitting, using _ (instead of -) means both types of splitting require a `shift` which keeps it a little more symmetrical if that's how your brain works!
- kaapipo 4y agoDepends on your keyboard layout. On my (Finnish) keyboard, | requires alt.
- sodapopcan 4y agoAh right, fair enough!
- __m 4y agoI switched from a German layout to a US layout, mainly because of objective-c with its []. Most default key bindings feel natural that way.
- h4waii 4y agoI don't use it a lot, but it's super handy to have this binding.
- penguin_booze 4y agoI've bound the keys 'v' and 's' for vertical and horizontal splitting to match Vim's default bindings. What tmux calls horizontal and vertical splits is inverse of those in Vim - hence -h flag for what most would call as vertical split. I suspect one of the authors was Australian!
- 4y ago
- lajosbacs 4y agoDoes someone know about a way to get autocomplete into tmux? Something like iterm2 has
- cbarrick 4y agoiTerm2 has a native tmux integration mode, where tmux windows become native tabs/windows, with native scroll back etc. https://iterm2.com/documentation-tmux-integration.html https://iterm2.com/documentation-tmux-integration.html
- sozforex 4y agoIf you use a WM with multiple named workspaces/tags - it is nice to have a key binding to run a terminal with a startup script (instead of the default shell) that creates or attaches to a tmux session with same name as the currently active workspace.
- almog 4y agoIf you're used to Vim key binding, you should feel at home with tmux after setting up Vim-like keybindings to move around (select panes/windows and resize): bind h select-pane -L bind l select-pane -R bind k select-pane -U bind j select-pane -D bind -r C-h select-window -t :- bind -r C-l select-window -t :+ bind -r H resize-pane -L 5 bind -r J resize-pane -D 5 bind -r K resize-pane -U 5 bind -r L resize-pane -R 5 I read Brian Hogan's 2012 edition of "tmux: Productive Mouse-Free Development". It was short and made me comfortable enough with tmux that since then I rarely ever use the terminal without starting a tmux session first. I see now that the book has been revised in 2016 for tmux 2 and perhaps I'll re-read it to see what I've missed.
- markuta 4y agoI wish the 256 colour setting was enabled by default. I always end up adding the following to my .tmux.conf file: set -g default-terminal "screen-256color"
- deleted 4y ago[deleted]
- osigurdson 4y agoIs there any way to make it look “real purdy” like Windows Terminal with the git profile. ls shines and vim pops with gorgeous magentas - pure terminal nirvanasphere.
- _0w8t 4y agoThese days I mostly stopped using tmux over ssh. If one can install software on a remote system, then I just run a VNC server and use a GUI editor or IDE to edit things. The big plus of this is that copy-paste just works and I can use various shortcuts that are problematic inside a terminal emulator. And if one can use xpra, then running a GUI terminal remotely over a fat but high-latency link can be faster than using tmux on a remote system. The terminal protocol was originally designed for slow but low latency links and is not good at latency hiding. And if I cannot install, then it is likely that tmux is not available either. So I use lsyncd to edit locally and transfer the edits to the remote system. For running commands I just run ssh host command then.
- Twirrim 4y ago> For running commands I just run ssh host command then That's fine, right up until the point you're running a command (or a series of commands) that change things on the machine and your connection gets broken. When that happens there's a very good chance the command being executed will fail in some fashion. If you're very lucky it won't be a big deal, but depending on what you're doing it could be dangerous. I would strongly advocate for using either screen or tmux as a matter of course on any remote server when you're executing commands on it. You don't need to do anything more with them other than just have a single window in it. You just don't want the command execution to be specifically tied to your SSH session. At the very least, screen or tmux enables you to get right back to what you were doing with no loss of output, and at the most it enables whatever commands you were executing to finish executing without risk of broken pipes killing them mid-flow or whatever else might end up being catastrophic.
- lamontcg 4y ago> That's fine, right up until the point you're running a command (or a series of commands) that change things on the machine and your connection gets broken. When that happens there's a very good chance the command being executed will fail in some fashion. If you're very lucky it won't be a big deal, but depending on what you're doing it could be dangerous. I spent 5 years at Amazon (back a long time ago) being incredibly aggressive with command line root-trust from the old bastion host they had there, working up to regularly executing ssh commands to all 30,000 servers (like I said it was a long time ago, but that's still a considerable stack) every single day. It is the kind of idea that gives a lot of people the vapours to think about, and I wouldn't recommend it if you had good alternatives. But Amazon never turned into a smoking hole, and I never once saw this kind of problem. I certainly had to deal with network issues, and the scripts I used were pretty robust against problems. Most often servers would be crashed and fail to ping, packets would get lost but retransmissions would succeed, or the kernel would be hung only responding to interrupts and userspace was all deadlocked, but sometimes the servers had some resource starvation issues and it would just be very slow and the command would timeout. Nothing bad every happened. I occupy some weird space though where I'm stupid enough to try these kinds of things and just careful enough to not get bitten by them. I've also been a trained cave diver for over a decade now as well (if you get the training and follow the rules, it is safer than driving on the roads in Mexico). And really you should always be using configuration management to change the state of servers and should have some kind of agent doing that automatically for you (although I've broken that rule probably a thousand times myself), and you should also ensure that what you're doing is 'idempotent', so that if it fails due to some transient error then you can just keep on hammering on the server and the next time or the time after that or whatever it will fix itself. This is the "self-healing" or "computer immunology" concept of configuration management that Mark Burgess came up with back in 1998 or so. If the process gets interrupted just run the process again. That may require some care taken around intermediate states and recovery from intermediate states, but that is just config management 101.
- craques 4y agojust got introduced to it whilst traversing this course which I highly recommend regardless of technical level https://missing.csail.mit.edu/ https://missing.csail.mit.edu/
- tupolef 4y agoI use URxvt and a systemd-run to daemonize tmux even if I close my graphical session. I use a function for the local tmux session and an alias for remote ssh tmux sessions, with a different bindings (MOD+x & MOD+w). Like that I am always in tmux localy and remotely just by launching URxvt. # open a new tmux session named ssh_tmux or attach to it alias tmuxs='tmux new-session -A -s ssh_tmux && exit' # open a new default tmux session with a named default or attach if it exist tmuxa () { systemd-run -q --scope --user tmux new-session -A -s default "$@" exit } # run tmux if TMUX variable is null if [[ "${TERM-}" != tmux* ]] && [[ -z "${TMUX}" ]] && [[ -z "${SSH_CONNECTION}" ]]; then tmuxa elif [[ -z "${TMUX}" ]] && [[ -n "${SSH_CONNECTION}" ]]; then tmuxs fi
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- mynameisash 4y agoSince no one's mentioned it in the comments, I occasionally use tmux's pane synchronization to run the same command across multiple panes: CTRL-B, then "set synchronize-panes". I've done this to do things like log into multiple different servers and startup some process all at the same time. 'set synchronize-panes' toggles this behavior, so when you're done, run the same command again to disable it.
- overtomanu 4y agoOne important feature is to enter copy mode, select and copy text without using mouse enter copy mode: LEADER [ highlight text to copy: press space and then arrow w and b to highlight words (like vi editor) exit copy mode: press enter key or Q paste copied text: LEADER ] OR cmd+V
- willhoyle 4y agoI’ve had to stop using tmux on macOS (MacBook Pro 2018). For some reason I kept getting extreme slowdowns/laggy behaviour when using neovim. I’ve seen this thread: https://github.com/tmux/tmux/issues/353 https://github.com/tmux/tmux/issues/353 I tried everything in the thread and still end up with a laggy terminal. For now I just use iterm2 with tabs but I miss my tmux. On my personal Linux laptop, I never encounter the same lag with the same setup.
- RVRX 4y agoiTerm2 actually offers nice interfacing with tmux. If you run `tmux -CC` it will start a tmux session that iTerm abstracts away letting you split and switch panes as you normally would in iTerm, but still allowing you to join the tmux session on another terminal. https://iterm2.com/documentation-tmux-integration.html https://iterm2.com/documentation-tmux-integration.html
- willhoyle 4y agoThat looks interesting, I’ll have to give that a try thanks!
- LargeTomato 4y agoTmux is the one tool I use every day at every company I've been with. At my current employer we have a lot of new grads and I strongly encourage them all to use tmux. We have a about a third of our devs on tmux now and they all love it. I have converted many devs, young and old, to use tmux. Once you get the hang of things you are hooked and you can learn 80% of tmux in 10 minutes.
- TwentyPosts 4y agoHere's a kind of dumb question: Are the primary usecases of this for SSH, or for non-tiling desktop environments? People say a lot of good stuff about it, but I struggle to figure out what it can do for me when I'm just doing stuff on a local computer, where I can just create new terminal windows.
- pizza 4y agoTo some extent it's mostly equivalent to using terminal windows. You can do other stuff w/ it but most of the time it's for managing lots of panes/windows. Personally I really just like its UI and it works really well w/ my workflows. I actually used to run tmux + vim splits + i3wm and managed to find myself really using the heck out of some really gnarly tiling schemes at times. Talking 10+ panes of really tiny windows at once, just on the fly. And then when I need to zoom in on one file in some pane, boom, ctrl+b+z and it's maximized.
- j1elo 4y agoThis is my single most repeated action on a normal terminal window: * Clear and discard all scrollback history: Ctrl+Shift+K * Start a program run * Select all output: Ctrl+Shift+A * Copy it: Ctrl+Shift+C * Paste it somewhere else A total of 3 key combinations, that are now second nature. When I installed Tmux and tried to replicate this, I only found a sea of gotchas. No key binding by default for clearing the scroll; similarly, no way to select all text with one single keypress; no way to copy the selected text so I can paste it in other applications. Given enough time, of course, all of these can be solved one by one, assuming enough motivation and free time (use custom configs, configure xclip, etc) but the default onboarding experience was a bit poor, to be honest. This is not a fault specifically of Tmux, but more of the typical lack of cohesion between different components that are considered independent tools albeit from the user pow they are arguably part of the same thing. I might have to revisit Tmux by means of Byobu [0] and see if this time it clicks. [0]: https://www.byobu.org/ https://www.byobu.org/
- greazy 4y agoWhy are you copy pasting? I'm sure you know about stdout redirection, so I'm intrigued why this process is required. I'm guessing you're pasting logs into some gui system?
- j1elo 4y agoI like starting from a clean slate and having only the output from last run of my program, so that's why the clearing screen step. Then, the copy-paste is not done always, but it's done a lot when analyzing logs or debugging some issue. I prefer to read that output with the much more advanced filtering and searching tools that I have installed in my VSCode editor.
- kramerger 4y agoAfter years of wrestling with configurations and dot files, I have finally realised that if you use a new tool, you should learn to use it properly and as intended by the author instead of trying to make it behave similar to some other tool you know well. At least for the first couple of years
- pizza 4y agoFavorite tmux conf change: new pane/window in cwd # split in pane cwd bind '"' split-window -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}"
- ahurmazda 4y agoYes!! I've terrible memory ... these are my mnemonics instead "|" -- for vertical split "-" -- for horizontal split
- kramerger 4y agoI love tmux but there is one thing that really bugs me: why isn't mouse support enabled by default? Annoys the hell out of me every time I used it on new machine.
- kgbcia 4y agois there a text based window manager that's browsable and uses the arrow keys?
- sudo_chmod777 4y agoLooks like no one has mentioned https://github.com/gpakosz/.tmux https://github.com/gpakosz/.tmux You still need to learn the basics but this lowers the learning curve a lot.