我同时使用 alacritty 和 tmux。是否可以在每次启动 alacritty 时都运行 tmux?
是的。在
shell
选项中,您可以设置要运行的程序,甚至可以传入参数。例如,在您的 alacritty.yml
文件中,您可以这样设置:
shell:
program: /usr/local/bin/tmux # <- set this to the path of your tmux installation
args:
- new-session
- -A
- -D
- -s
- main
每次启动 alacritty 时,tmux 都会启动一个新会话并传递其他参数。
或者走简单的路线并以这种方式启动您的终端:
alacritty -e tmux
我正在使用这个脚本: https://cedaei.com/posts/ideas-from-my-dev-setup-always-tmux/ 来自 https://lobste.rs/s/n5blid/ideas_from_my_development_setup_always
并快速使用它:
shell:
program: /home/user/.local/bin/tmux_chooser.sh
在较新版本的 Alacritty 上,它使用 toml。在 Alacritty 配置文件(通常位于 .config/alacrtty 中)中,您可以进行以下设置:
[shell]
program = "tmux"
完成此设置后,Alacritty 将打开并默认启动 Tmux。