Default Alacritty terminal for WSL2
I just installed WSL2 with Ubuntu 20.04 on my Windows 10 machine and I also installed Alacritty terminal emulator for Windows. I'm wondering is there a way to make WSL to default into using Alacritty terminal over the default one? If so, any idea how to achieve it? Alacritty's github didn't say much about WSL ().
22 Answers
Short answer, there's currently no way to change the default terminal that launches for any console app (WSL, PowerShell, CMD, etc.).
The good news is that this will soon change. Starting with Windows 10 build 21390 (Insider/Preview), you can select between the older Windows Console (which is currently the default) and the newer Windows Terminal.
The bad news is that even in the Insider/Preview version, there's no way that I know of to set it to a third-party app like Alacritty. I don't have any information on whether or not that is a planned feature before release or not. I'd guess, given the proximity to the H2 release (or potentially now Windows 11), that it will not be added.
Your best bet would be to create a small .ps1 or .cmd script that would launch Alacritty with WSL. You could then add that as a shortcut to the Start Menu for quick access. Pinning it to the Start or Task bar would also be a possibility.
modify your alacritty.yml shell section as below:
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
shell: program: ubuntu
# args:
# - --login