Skip to content

Software Engineer at Heydoc

Autostart tmux on Alacritty launch

After using Hyper for a long time, I recently tried Alacritty for the first time and I decided to switch almost instantly. This OpenGL powered terminal emulator is crazy fast, lightweight and configurable. Love it!

At the time of writing this post it doesn’t support multiple windows, although I know that the support for multiple windows in Alacritty is coming soon. No biggie for me because tmux can solve this limitation quickly. Ideally, I wanted to use this terminal multiplexer whenever I launch Alacritty. If you are after a similar solution, I have a solution that works like a charm.

# ~/.alacritty.yml

shell:
  program: /bin/zsh
  args:
    - -l
    - -c
    - "tmux attach || tmux"

tmux running in Alacritty

If tmux session exists, this command will automatically attach to it. It will create a new session otherwise. A quick, simple tip for y’all today. Enjoy geeks!

Comments

  • c
    clintfred

    Note that the file above should be .alacritty.yml not .yaml

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Uuuups! Sorry, you are absolutely right clintfred. Corrected. Thank you a lot.

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • L
    LanZadura

    Hey, thanks a lot!

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!

Leave a comment

👆 you can use Markdown here

Your comment is awaiting moderation. Thanks!