<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tags — Nikita's Blog</title><link>https://nik-avg.org/tags/</link><description>Personal blog about technologies, programming, and life in general.</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 05 Jul 2026 16:30:33 +0400</lastBuildDate><atom:link href="https://nik-avg.org/tags/" rel="self" type="application/rss+xml"/><item><title>Why Tmux?</title><link>https://nik-avg.org/posts/why_tmux/</link><pubDate>Sat, 04 Jul 2026 00:00:00 +0000</pubDate><guid isPermaLink="true">https://nik-avg.org/posts/why_tmux/</guid><description><p>Hi! Well, it&rsquo;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!</p><h2 id="what-i-thought-the-tmux-was" class="heading-wrapper">
What I thought the Tmux was<a class="heading-anchor" href="#what-i-thought-the-tmux-was" aria-label="Permalink to this heading"/></h2><p>I&rsquo;ve been in the IT world for years already (for 11 years actually), and of
course I&rsquo;ve heard of Tmux before. But I&rsquo;ve never tried it until last year.</p><p>I was sure that it&rsquo;s some old tool made and used by sysadmins only when they
need to run long sessions on remote servers. And it wasn&rsquo;t exactly wrong. And I
saw people using it exactly this way.</p><p>For example, you need to run a migration in your db after an update. It&rsquo;s a long
process, you don&rsquo;t want this process to be interrupted, so you can&rsquo;t rely only
on your SSH connection, or yourself not closing the terminal windows
accidentally. In this case you can just run<code>tmux</code> on a remote host, run the
migration and do whatever you want (except for<code>:kill-session</code> for obvious
reasons). In case of any problem you can just connect back to this host, connect
to the same Tmux session (just<code>tmux a</code> usually) and boom, you&rsquo;re back in
business, migration is still running, you can look at it closely and pretend
you&rsquo;re working hard.</p><p>And that&rsquo;s all! That&rsquo;s all this piece of software does.</p><p>Or is it?</p><h2 id="long-ricing-way-to-tmux" class="heading-wrapper">
Long ricing way to Tmux<a class="heading-anchor" href="#long-ricing-way-to-tmux" aria-label="Permalink to this heading"/></h2><p>At the beginning of my career I was a windows guy. I even was an administrator
for a bunch of windows servers.</p><p>Luckily I stopped being a sinner and at some point accepted Linux.</p><p>And the OS I started with was, btw, Arch Linux.</p><p>I 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.</p><p>I 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).</p><p>I was really happy using it. Though I also struggled a lot…</p><p>It&rsquo;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.</p><p>Then I tried all the other things like Sway, bspwm, Hyprland, you name it. But
we&rsquo;ll skip this part because the post is about Tmux.</p><p>At the end of this part of my life I had to move to another country, and I
decided to take my wife&rsquo;s MacBook Pro instead of my own laptop with Linux,
because it was more reliable, and I couldn&rsquo;t afford to fix yet another Arch
update at that time.</p><p>And that&rsquo;s how the reassessment-of-values part started.</p><h2 id="do-i-even-need-a-system-from-scratch" class="heading-wrapper">
Do I even need a system from scratch?<a class="heading-anchor" href="#do-i-even-need-a-system-from-scratch" aria-label="Permalink to this heading"/></h2><p>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.</p><p>I decided to give macOS a chance and use it as intended. And you know what? I
got used to it.</p><p>And after I got used to it I realized that the only thing I needed i3 and tiling
for specifically was my terminal.</p><p>So I spent some time learning iTerm2 bindings for tabs and panes. And that&rsquo;s
all. I finally was happy. Nothing breaks, everything works, and I have kinda
tiling in my terminal.</p><p>After 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).</p><p>Soon after I realized that I&rsquo;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&rsquo;t have time for ricing, configuring, problem solving on my
working system.</p><p>And the solution was: Fedora + KDE.</p><p>Yeah, I just installed it and it was fine.</p><p>But what about the terminal? I still needed all these tabs, panes, and other
stuff. I tried Kitty, Ghostty, they&rsquo;re amazing, but it was always hard to switch
between my Linux environment with these terminal emulators and macOS with
iTerm2.</p><h2 id="how-i-learned-to-stop-worrying-and-love-tmux" class="heading-wrapper">
How I learned to stop worrying and love Tmux<a class="heading-anchor" href="#how-i-learned-to-stop-worrying-and-love-tmux" aria-label="Permalink to this heading"/></h2><p>I can&rsquo;t remember exactly why Tmux came back to my mind, it was probably one of
the YouTube videos I&rsquo;ve seen about useful Linux tools. After watching it I found
out that it has tabs<code>windows</code>, panes, and even sessions. That you can split
panes in different ways, you can switch between windows and sessions, move
everything and so on.</p><p>And I gave it a chance (finally, after 10 years).</p><p>I&rsquo;ve installed it on my Mac and Fedora and stopped using any terminal emulator
features, just Tmux, nothing more.</p><p>And boy oh boy, it was AMAZING.</p><p>All the key bindings are the same, the behavior is the same as well, and I don&rsquo;t
even need to think about which system I&rsquo;m working on anymore.</p><p>So 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&rsquo;t
even remember because I almost never need to change it.</p><h3 id="my-workflow" class="heading-wrapper">
My workflow<a class="heading-anchor" href="#my-workflow" aria-label="Permalink to this heading"/></h3><p>Now, how I use Tmux.</p><p>Each day I start my computer, open up the terminal emulator (at this point it
doesn&rsquo;t even matter which one, but I just use Konsole on Fedora), and run<code>tmux</code>
(yes, just like that, no arguments, nothing really special).</p><p>Then I just start working. If I need to see two pieces of something together, I
create panes with<code>&lt;prefix&gt;+"</code> or<code>&lt;prefix&gt;+%</code>. If I need another window (tab) I
create it with<code>&lt;prefix&gt;+c</code>. And if I need to switch to something unrelated to
the current task I just create a separate session for that with<code>&lt;prefix&gt;+: new -s name</code>.</p><p>That&rsquo;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.</p><h3 id="my-config" class="heading-wrapper">
My config<a class="heading-anchor" href="#my-config" aria-label="Permalink to this heading"/></h3><p>My config is pretty simple, you can see it here:<a href="https://github.com/ronedier/dotfiles/blob/main/.config/tmux/tmux.conf" target="_blank" rel="noopener noreferrer">https://github.com/ronedier/dotfiles/blob/main/.config/tmux/tmux.conf</a></p><p>But I want to highlight some things.</p><p><strong>Do not change the prefix key. Just get used to it.</strong></p><p>I&rsquo;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&rsquo;s not that hard to type<code>ctrl+b</code>. I recommend remapping your<code>CapsLock</code> key to<code>CTRL</code>; it will give you much more than changing the prefix
key in Tmux.</p><p><strong>Do not change the bind-key for window splitting.</strong></p><p>I&rsquo;ve seen a lot of configs and recommendations which tell you to do that, mostly
because people can&rsquo;t memorize the standard binds. Well, I&rsquo;ll tell you how to
memorize it.</p><p>Look where the<code>%</code> 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<code>&lt;prefix&gt;+%</code> splits your
window with a vertical line in half.</p><p>Now look where the<code>"</code> 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<code>&lt;prefix&gt;+"</code>
splits your window with a horizontal line in half.</p><p>What you can change in split-window behavior is this</p><div class="code-block-wrapper"><div class="code-block-header"><span class="code-block-lang">plain</span><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></div><div class="code-block-body"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">## Split window and cd to the current path</span></span><span class="line"><span class="cl">bind-key % split-window -h -c '#{pane_current_path}'</span></span><span class="line"><span class="cl">bind-key '"' split-window -v -c '#{pane_current_path}'</span></span><span class="line"><span class="cl">## Create window and cd to the current path</span></span><span class="line"><span class="cl">bind-key c new-window -c '#{pane_current_path}'</span></span></code></pre></div></div></div><p>Because changing directory back to your current project path every time you need
an additional pane or window is pretty annoying.</p><p>The main key binding you need to remember is<code>&lt;prefix&gt;+?</code>. It&rsquo;s easy to guess
that it opens a help window with all the other key bindings. You can just search
it. You don&rsquo;t even need a cheat sheet. (But you can use this if you want to:<a href="https://tmuxcheatsheet.com/" target="_blank" rel="noopener noreferrer">https://tmuxcheatsheet.com/</a>
).</p><p><strong>You don&rsquo;t need to remember each key binding or even use all of them.</strong></p><p>I remember only maybe 6 which I use regularly. For a lot of things you can just
run<code>&lt;prefix&gt;+:</code> 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.</p><p>You&rsquo;ll definitely want this to clear both screen and scrollback history:</p><div class="code-block-wrapper"><div class="code-block-header"><span class="code-block-lang">plain</span><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></div><div class="code-block-body"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">## clear scrollback history (like cmd+k in iTerm)</span></span><span class="line"><span class="cl">bind-key -n C-l send-keys C-l \; send-keys -R \; clear-history</span></span></code></pre></div></div></div><p>You want this to make your window indexes start from 1 instead of 0</p><div class="code-block-wrapper"><div class="code-block-header"><span class="code-block-lang">plain</span><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></div><div class="code-block-body"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl"># Start windows and panes at 1, not 0</span></span><span class="line"><span class="cl">set -g base-index 1</span></span><span class="line"><span class="cl">setw -g pane-base-index 1</span></span><span class="line"><span class="cl">set -g renumber-windows on</span></span></code></pre></div></div></div><p>I can&rsquo;t imagine why someone may want to start it from 0 since it&rsquo;s a pretty
uncomfortable key to press.</p><p>You want this as well:</p><div class="code-block-wrapper"><div class="code-block-header"><span class="code-block-lang">plain</span><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></div><div class="code-block-body"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">set-option -g detach-on-destroy off</span></span></code></pre></div></div></div><p>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).</p><h2 id="la-finale" class="heading-wrapper">
La Finale<a class="heading-anchor" href="#la-finale" aria-label="Permalink to this heading"/></h2><p>That&rsquo;s all you need to know.</p><p>Now 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).</p><p>As you can see, I spent more time explaining my way to Tmux than Tmux itself,
because I think it&rsquo;s more important to understand why you use a tool, instead of
explaining how it works, especially if this tool is so simple.</p></description></item></channel></rss>