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"

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!
Note that the file above should be
.alacritty.yml
not.yaml
Uuuups! Sorry, you are absolutely right clintfred. Corrected. Thank you a lot.
Hey, thanks a lot!
Thanks, a lot, that was helpful! :)
I am glad you found it useful.
It works
Nice 💣
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
It just works. Great, thx!
Pleasure!
wow, simple but powerful