Skip to content

Instantly share code, notes, and snippets.

@lehmanjo
Created September 2, 2024 06:17
Show Gist options
  • Save lehmanjo/7958f9e6a6a4c00991eccd8cd0b40119 to your computer and use it in GitHub Desktop.
Save lehmanjo/7958f9e6a6a4c00991eccd8cd0b40119 to your computer and use it in GitHub Desktop.

Alacritty

Alacritty on Windows 11 with MSYS2 UCRT64 bash with custom home directory

Install

  1. Install Alacrity for Windows from https://alacritty.org/
  2. Install MSYS2 for Windows from https://www.msys2.org/
  3. Create minimal TOML configuration file for Alacritty

alacritty.toml in %APPDATA%\alacritty

[window]
opacity = 1.0
startup_mode = "Windowed"
padding.x = 10
padding.y = 10
decorations = "Full"

[window.dimensions]
columns = 128
lines = 48

[font]
size = 13.0
  1. Launch Alacritty on Windows to make sure it works.

Integrate with MSYS2 UCRT64 and Bash

  1. Add [shell] section in your TOML configuration file. Update according to your installation of MSYS2.
[shell]
program = 'c:\msys64\msys2_shell.cmd'
args = [ "-defterm", "-here", "-no-start", "-ucrt64", "-shell", "bash" ]

Set your own custom home directory (e.g. network drive)

  1. Modify [shell] section to below
[shell]
program = 'c:\msys64\msys2_shell.cmd'
args = [ "-defterm", "-no-start", "-ucrt64", "-shell", "bash" ]
  1. Edit /etc/nsswitch.conf in MSYS2 (e.g. c:\msys64\etc\nsswitch.conf)
# Begin /etc/nsswitch.conf

passwd: files db
group: files db

db_enum: cache builtin

db_home: cygwin desc
db_shell: cygwin desc
db_gecos: cygwin desc

# End /etc/nsswitch.conf
  1. Add a path to db_home

e.g. c:\temp

db_home: /c/temp cygwin desc

e.g. H:\

db_home: /h cygwin desc

e.g. Windows home directory

db_home: windows cygwin desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment