Skip to content Paweł Grzybek

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!
  • D
    Dominik Stańczak

    Thanks, a lot, that was helpful! :)

    👆 you can use Markdown here

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

      I am glad you found it useful.

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • S
    Suryakant

    It works

    👆 you can use Markdown here

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

      Nice 💣

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • R
    Ru

    Hello and thanks for your post.

    Just my 5 cents, you can run directly tmux without using zsh. Regards :)

    shell: program: /usr/local/bin/tmux args: - new-session - -A - -D - -s - main

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
  • W
    Wojciech

    It just works. Great, thx!

    👆 you can use Markdown here

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

      Pleasure!

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • N
    Naranyala

    wow, simple but powerful

    👆 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!