[{"content":"Hi! Well, it’s kind of my first post here, and I mainly try to test the blog and everything. But Tmux was on my list of things to write about, and I use it every day, so why not start with it!\nWhat I thought the Tmux was I’ve been in the IT world for years already (for 11 years actually), and of course I’ve heard of Tmux before. But I’ve never tried it until last year.\nI was sure that it’s some old tool made and used by sysadmins only when they need to run long sessions on remote servers. And it wasn’t exactly wrong. And I saw people using it exactly this way.\nFor example, you need to run a migration in your db after an update. It’s a long process, you don’t want this process to be interrupted, so you can’t rely only on your SSH connection, or yourself not closing the terminal windows accidentally. In this case you can just run tmux on a remote host, run the migration and do whatever you want (except for :kill-session for obvious reasons). In case of any problem you can just connect back to this host, connect to the same Tmux session (just tmux a usually) and boom, you’re back in business, migration is still running, you can look at it closely and pretend you’re working hard.\nAnd that’s all! That’s all this piece of software does.\nOr is it?\nLong ricing way to Tmux At the beginning of my career I was a windows guy. I even was an administrator for a bunch of windows servers.\nLuckily I stopped being a sinner and at some point accepted Linux.\nAnd the OS I started with was, btw, Arch Linux.\nI quickly realized that the most important thing in your Linux environment is a window manager. I also realized that the i3wm is the best one.\nI spent days configuring it. I wrote a lot of scripts, changed a lot of key bindings, set all the workspaces (and the icons for all of them of course).\nI was really happy using it. Though I also struggled a lot…\nIt’s definitely a lack of skills, but it was breaking a lot. Some windows showed only a white screen (PyCharm), floating windows were always a mess, and the whole automation around the system tended to fail on every update (not exactly an i3 problem, but come on, you know what I mean). In other words, it was really hard to build a reliable system from scratch.\nThen I tried all the other things like Sway, bspwm, Hyprland, you name it. But we’ll skip this part because the post is about Tmux.\nAt the end of this part of my life I had to move to another country, and I decided to take my wife’s MacBook Pro instead of my own laptop with Linux, because it was more reliable, and I couldn’t afford to fix yet another Arch update at that time.\nAnd that’s how the reassessment-of-values part started.\nDo I even need a system from scratch? So I started to use a Mac. Everything was new and uncomfortable. I tried to recreate the same environment I had on Linux. It was always a mess.\nI decided to give macOS a chance and use it as intended. And you know what? I got used to it.\nAnd after I got used to it I realized that the only thing I needed i3 and tiling for specifically was my terminal.\nSo I spent some time learning iTerm2 bindings for tabs and panes. And that’s all. I finally was happy. Nothing breaks, everything works, and I have kinda tiling in my terminal.\nAfter some years of working on a 10-year-old Mac I decided that I needed an upgrade (tbh it was mostly the lack of gaming options on the old Mac). I built a PC, which I might write a separate post about. And I installed on it what? Arch Linux with i3 of course (lightning strikes stupid people twice).\nSoon after I realized that I’m too old for this shit. I have a lot of tasks, I have my team I need to manage, and I have my beautiful son I need to manage even more. I just don’t have time for ricing, configuring, problem solving on my working system.\nAnd the solution was: Fedora + KDE.\nYeah, I just installed it and it was fine.\nBut what about the terminal? I still needed all these tabs, panes, and other stuff. I tried Kitty, Ghostty, they’re amazing, but it was always hard to switch between my Linux environment with these terminal emulators and macOS with iTerm2.\nHow I learned to stop worrying and love Tmux I can’t remember exactly why Tmux came back to my mind, it was probably one of the YouTube videos I’ve seen about useful Linux tools. After watching it I found out that it has tabs windows, panes, and even sessions. That you can split panes in different ways, you can switch between windows and sessions, move everything and so on.\nAnd I gave it a chance (finally, after 10 years).\nI’ve installed it on my Mac and Fedora and stopped using any terminal emulator features, just Tmux, nothing more.\nAnd boy oh boy, it was AMAZING.\nAll the key bindings are the same, the behavior is the same as well, and I don’t even need to think about which system I’m working on anymore.\nSo the fact is, the tool I knew about since the beginning of my career gave me everything I needed with something like 20 lines of configuration which I can’t even remember because I almost never need to change it.\nMy workflow Now, how I use Tmux.\nEach day I start my computer, open up the terminal emulator (at this point it doesn’t even matter which one, but I just use Konsole on Fedora), and run tmux (yes, just like that, no arguments, nothing really special).\nThen I just start working. If I need to see two pieces of something together, I create panes with \u003cprefix\u003e+\" or \u003cprefix\u003e+%. If I need another window (tab) I create it with \u003cprefix\u003e+c. And if I need to switch to something unrelated to the current task I just create a separate session for that with \u003cprefix\u003e+: new -s name.\nThat’s all. All the struggling, reading manuals, and trying yet another cool tool was replaced with one tool, 20 lines of config, and hardly 5 key bindings.\nMy config My config is pretty simple, you can see it here: https://github.com/ronedier/dotfiles/blob/main/.config/tmux/tmux.conf But I want to highlight some things.\nDo not change the prefix key. Just get used to it.\nI’ll definitely write another post about default key bindings in general, but for now just think about being able to use Tmux anywhere without relying on your specific setup. It’s not that hard to type ctrl+b. I recommend remapping your CapsLock key to CTRL; it will give you much more than changing the prefix key in Tmux.\nDo not change the bind-key for window splitting.\nI’ve seen a lot of configs and recommendations which tell you to do that, mostly because people can’t memorize the standard binds. Well, I’ll tell you how to memorize it.\nLook where the % symbol is on your keyboard. Try to draw the line from this key. The only meaningful way to do it is vertically. This way you split your keyboard with a vertical line in half. The same way as \u003cprefix\u003e+% splits your window with a vertical line in half.\nNow look where the \" symbol is on your keyboard. Try to draw the line from this key again. The only meaningful way to do it is horizontally. This way you split your keyboard with a horizontal line in half. The same way as \u003cprefix\u003e+\" splits your window with a horizontal line in half.\nWhat you can change in split-window behavior is this\nplain Copy ## Split window and cd to the current path bind-key % split-window -h -c '#{pane_current_path}' bind-key '\"' split-window -v -c '#{pane_current_path}' ## Create window and cd to the current path bind-key c new-window -c '#{pane_current_path}' Because changing directory back to your current project path every time you need an additional pane or window is pretty annoying.\nThe main key binding you need to remember is \u003cprefix\u003e+?. It’s easy to guess that it opens a help window with all the other key bindings. You can just search it. You don’t even need a cheat sheet. (But you can use this if you want to: https://tmuxcheatsheet.com/ ).\nYou don’t need to remember each key binding or even use all of them.\nI remember only maybe 6 which I use regularly. For a lot of things you can just run \u003cprefix\u003e+: which will open a Tmux command line and type the function you want to run. Set a key binding for it or memorize the existing key binding only if you use this function regularly.\nYou’ll definitely want this to clear both screen and scrollback history:\nplain Copy ## clear scrollback history (like cmd+k in iTerm) bind-key -n C-l send-keys C-l \\; send-keys -R \\; clear-history You want this to make your window indexes start from 1 instead of 0\nplain Copy # Start windows and panes at 1, not 0 set -g base-index 1 setw -g pane-base-index 1 set -g renumber-windows on I can’t imagine why someone may want to start it from 0 since it’s a pretty uncomfortable key to press.\nYou want this as well:\nplain Copy set-option -g detach-on-destroy off To make Tmux switch to another session instead of a full detach when you close the current one (or close the last window in the current session).\nLa Finale That’s all you need to know.\nNow you can use Tmux on any OS, with any terminal emulator, on your PC, laptop, or even on a remote server (just press your prefix twice if you run Tmux on the server while running Tmux on your machine).\nAs you can see, I spent more time explaining my way to Tmux than Tmux itself, because I think it’s more important to understand why you use a tool, instead of explaining how it works, especially if this tool is so simple.\n","date":"2026-07-04","summary":"\u003cp\u003eHi! Well, it’s kind of my first post here, and I mainly try to test the blog and\neverything. But Tmux was on my list of things to write about, and I use it every\nday, so why not start with it!\u003c/p\u003e\n\u003ch2 id=\"what-i-thought-the-tmux-was\" class=\"heading-wrapper\"\u003e\n  What I thought the Tmux was\n  \u003ca class=\"heading-anchor\" href=\"#what-i-thought-the-tmux-was\" aria-label=\"Permalink to this heading\"\u003e\u003c/a\u003e\n\u003c/h2\u003e\n\u003cp\u003eI’ve been in the IT world for years already (for 11 years actually), and of\ncourse I’ve heard of Tmux before. But I’ve never tried it until last year.\u003c/p\u003e","tags":["tools","tmux"],"title":"Why Tmux?","url":"/posts/why_tmux/"}]