9

I am using alacritty and tmux together. Is it possible to make tmux run everytime when I launch alacritty?

5 Answers 5

19

Yes. In the shell option, you can set the program you want to run and even pass in the arguments. For example, in your alacritty.yml file, you can set this:

shell:
  program: /usr/local/bin/tmux # <- set this to the path of your tmux installation
  args:
    - new-session
    - -A
    - -D
    - -s
    - main

Every time you start alacritty, tmux will start a new session and pass the other args.

0
5

Or go the easy route and launch your terminal this way:

alacritty -e tmux

3
  • 2
    Cool idea, but I'm guessing many won't have a terminal open to start another terminal :) Jul 4, 2021 at 22:53
  • You don't have to. Not sure what you're talking about. Go to your keybinds and change the launch parameters. Jul 6, 2021 at 6:46
  • True, though I don't launch alacritty with a key bind. Jul 6, 2021 at 15:50
2

i'm using this script: https://cedaei.com/posts/ideas-from-my-dev-setup-always-tmux/ had it from https://lobste.rs/s/n5blid/ideas_from_my_development_setup_always

and use it in alacritty as:

shell:
  program: /home/user/.local/bin/tmux_chooser.sh
0
1

On the newer versions of Alacritty, which use toml. In the Alacritty config file (usually found in .config/alacritty) you can set this:

[shell]
program = "tmux"

With that set, Alacritty will open with Tmux started by default.

1

Thanks to @jogarjia's answer i was able to create my solution. If you add these lines to your alacritty config file, Whenever you open a new alacritty window, it will try to connect a tmux session named "general", if it doesn't exist it will create it and attach to it.

shell:
  program: /usr/bin/tmux
  args:
    - new-session
    - -A
    - -s
    - general

Also please check if the tmux path is correct by:

where tmux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.