Created by potrace 1.16, written by Peter Selinger 2001-2019Navigate back to the homepage

TMux saving the day in 2020 [A Step-By-Step Guide] 🔥

Amr Elsekilly
July 6th, 2020 · 2 min read

TL;DR

Throughout the years, tmux has been on the top of the productivity tools that I use on a daily basis. It allows me to manage multiple projects simultaneously with ease in the terminal.

What’s tmux?

Simply put, tmux (Terminal Multiplexer) is a tool that you can use to easily manage working on projects in the terminal.

It allows you to have multiple sessions, in each session you can have multiple windows, and you can split each window into several panes.

You can think of a session as the biggest unit you could have in tmux, the window is a smaller part, and the panes are the smallest part of any window.

Any window could be split up to as many panes as you like. Personally, I prefer having at least 2 to 3 panes per project (window).

My setup

Back in the days when I first started using tmux, I was using Linux as my main OS. But right now, I’m using it on MacOS version 10.15.3.

My setup on Mac consists of

  1. iTerm2.
  2. tmux.

Setting-up tmux on MacOS

  • Install tmux via HomeBrew of OSX

    1brew install tmux
  • After downloaded, check the version

    1tmux -V
  • If you wanna start an unnamed session

    1tmux

    Start an unnamed session

  • To exit tmux

    1exit

    exit tmux

  • To start a named session

    1tmux new -t someProject

    start a named session

  • If you wanna keep a session running in the background, but you don’t wanna see it. You can detach a session.

    1tmux detach

    detach a session

  • If you wanna go back to a detached session. You can attach to it.

    1tmux attach -t someProject
  • To list all tmux sessions.

    1tmux ls

    list all tmux sessions

  • tmux prefix (the keys you press before any of the next shortcuts) is control + b.

  • Change the session’s number

    1<prefix> + $

    Change the session's number

  • Change Window Name

    1<prefix> + ,

    Change Window Name

  • Kill the Current Window

    1<prefix> + &
  • Split window into panes Vertically (top/bottom)

    1<prefix> + "

    split vertically

  • Split Horizontally (left/right)

    1<prefix> + %

    Split Horizontally

  • Kill the Current Pane

    1<prefix> + x

    or type

    1exit
  • Kill the existing sessions

    1tmux kill-server

Configuring the mouse for scrolling and navigation

I noticed an issue on MacOS using iTerm2, that the mouse can’t resize the pane size’s, it can’t either scroll, nor can switch between panes. Sometimes using the mouse makes things easier.

To get the mouse to work do the following

1nano ~/.tmux.conf

Then paste this into the file

1set-option -g mouse on

Save the file and run

1tmux source ~/.tmux.conf

Voila, your mouse is functional in tmux now! 🚀🔥

I hope that this article helps you become more productive at work. Don’t forget to subscribe to my mailing list if you wanna get notified about new posts in the future.

Join my mailing list to get notified about new content

Be the first to receive my latest content with the ability to opt-out at anytime. I promise not to spam your inbox or share your email with any third parties.

More articles from Amr Elsekilly

What's this blog gonna be about?

I started that by creating my YouTube channel, and getting involved with the tech community in Egypt and the middle-east by providing mentorship, and contributing to the community on social media, events, etc.

June 20th, 2020 · 1 min read

Leveraging React Helmet to Boost the SEO Score for Your React Single Page Applications

Discover how to boost your React Single Page Application's (SPA) SEO with React Helmet, a powerful tool for managing changes to your document's head tags. Dive into our comprehensive guide where we explore how to effectively leverage this reusable React component to improve your website's visibility on search engines, ultimately driving more traffic and engagement. From updating title tags and meta descriptions to managing canonical URLs and social media metadata, learn how to unlock the full potential of React Helmet for your React SPA's SEO.

June 14th, 2023 · 2 min read
© 2020–2023 Amr Elsekilly
Link to $https://linkedin.com/in/amrsekillyLink to $https://youtube.com/amrsekillyLink to $https://github.com/amrsekillyLink to $https://twitter.com/amrsekillyLink to $https://instagram.com/amrsekilly