Alacritty is a contemporary terminal emulator, characterized by sensible defaults yet allowing for extensive customization. By integrating with other applications, rather than reimplementing their functionalities, it offers a flexible and high-performance feature set. The currently supported platforms encompass BSD, Linux, macOS, and Windows.
If modification of the icon is not required, direct download is recommended:
Directly download the officially compiled installation package: https://alacritty.org/index.html
Manual Compilation Here, because the source code's icon is square with right angles and does not quite align with the macOS icon style, I have personally forked a version with a modified icon, thus necessitating manual compilation.
Install the Rust and Make environments:
bash# Install the Rust environment; if it already exists, this step can be skipped.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
brew install make
bash # Shallow clone the repository code.
git clone --depth 1 https://github.com/KevinYouu/alacritty.git
cd alacritty
# Compile for the current architecture.
make dmg
# Compile the universal architecture for macOS.
# dmg-universal
Subsequently, the compiled application and DMG file can be located in the alacritty/target/release/osx
directory. Simply place these into /Applications
for immediate use.
The following is my personalized configuration file:
toml[window]
dimensions = { columns = 80, lines = 24 }
padding = { x = 4, y = 0 }
opacity = 0.2
blur = true
[font]
normal = { family = "Roboto Mono", style = "Regular" }
bold = { family = "Roboto Mono", style = "bold" }
italic = { family = "Roboto Mono", style = "italic" }
bold_italic = { family = "Roboto Mono", style = "bold italic" }
size = 18
[selection]
save_to_clipboard = true
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
[cursor]
style = { shape = "Beam", blinking = "On" }
[terminal]
shell = { program = "/opt/homebrew/bin/fish", args = ["-l"] }
[colors.primary]
foreground = "#ffffff" # White
background = "#000000" # Black
[colors.normal]
black = "#000000"
red = "#ff3b30"
green = "#4cd964"
yellow = "#ffcc00"
blue = "#007aff"
magenta = "#ff2d55"
cyan = "#5ac8fa"
white = "#ffffff"
[colors.bright]
black = "#686868"
red = "#ff3b30"
green = "#4cd964"
yellow = "#ffcc00"
blue = "#007aff"
magenta = "#ff2d55"
cyan = "#5ac8fa"
white = "#ffffff"
[keyboard]
bindings = [
# Copy (Cmd + C)
{ key = "C", mods = "Command", action = "Copy" },
# Paste (Cmd + V)
{ key = "V", mods = "Command", action = "Paste" },
# Find (Cmd + F)
{ key = "F", mods = "Command", action = "SearchForward" },
# New Window (Cmd + N)
{ key = "N", mods = "Command", action = "CreateNewWindow" },
# Decrease Font Size (Cmd + -)
{ key = "Minus", mods = "Command", action = "DecreaseFontSize" },
# Increase Font Size (Cmd + =)
{ key = "Equals", mods = "Command", action = "IncreaseFontSize" },
# Reset Font Size (Cmd + 0)
{ key = "Key0", mods = "Command", action = "ResetFontSize" },
# Toggle Full Screen (Cmd + Enter)
{ key = "Return", mods = "Command", action = "ToggleSimpleFullscreen" },
# Switch to Specific Tab (Cmd + 1 ~ Cmd + 9)
{ key = "Key1", mods = "Command", action = "SelectTab1" },
{ key = "Key2", mods = "Command", action = "SelectTab2" },
{ key = "Key3", mods = "Command", action = "SelectTab3" },
{ key = "Key4", mods = "Command", action = "SelectTab4" },
{ key = "Key5", mods = "Command", action = "SelectTab5" },
{ key = "Key6", mods = "Command", action = "SelectTab6" },
{ key = "Key7", mods = "Command", action = "SelectTab7" },
{ key = "Key8", mods = "Command", action = "SelectTab8" },
{ key = "Key9", mods = "Command", action = "SelectTab9" },
# Hide Alacritty (Cmd + H)
{ key = "H", mods = "Command", action = "Hide" },
# Hide Other Applications (Cmd + Option + H)
{ key = "H", mods = "Command|Option", action = "HideOtherApplications" },
]
This document serves as a complete reference manual for Alacritty's alacritty.toml
configuration file.
Alacritty's configuration file uses the TOML format. The format's specification can be found at https://toml.io/en/v1.0.0
.
Alacritty does not create the configuration file for you, but it looks for one in the following locations.
On UNIX systems:
$XDG_CONFIG_HOME/alacritty/alacritty.toml
$XDG_CONFIG_HOME/alacritty.toml
$HOME/.config/alacritty/alacritty.toml
$HOME/.alacritty.toml
On Windows:
%APPDATA%\alacritty\alacritty.toml
[general]
- General ConfigurationThis section documents the [general]
table of the configuration file.
import
["<string>", ...]
~/
), or relative to the config file's location.working_directory
"<string>"
or "None"
"None"
, the working directory of the parent process is used."None"
live_config_reload
true
| false
true
ipc_socket
true
| false
alacritty msg
.true
[env]
- Environment VariablesAll key-value pairs in the [env]
section will be added as environment variables for any process spawned by Alacritty, including its shell.
toml[env]
WINIT_X11_SCALE_FACTOR = "1.0"
[window]
- Window ConfigurationThis section documents the [window]
table of the configuration file.
dimensions
{ columns = <integer>, lines = <integer> }
columns
must be at least 2
. Changes require a restart.{ columns = 0, lines = 0 }
position
{ x = <integer>, y = <integer> }
or "None"
"None"
, the window manager will handle placement."None"
padding
{ x = <integer>, y = <integer> }
{ x = 0, y = 0 }
dynamic_padding
true
| false
false
decorations
"Full"
| "None"
| "Transparent"
| "Buttonless"
Full
: Includes borders and a title bar.None
: Has neither borders nor a title bar.Transparent
(macOS only): Provides a title bar with a transparent background.Buttonless
(macOS only): Similar to Transparent
but without title bar buttons."Full"
opacity
<float>
0.0
(completely transparent) to 1.0
(opaque).1.0
blur
true
| false
false
startup_mode
"Windowed"
| "Maximized"
| "Fullscreen"
| "SimpleFullscreen"
Windowed
: Starts as a regular window.Maximized
: Starts maximized.Fullscreen
: Starts in fullscreen mode.SimpleFullscreen
(macOS only): A form of fullscreen that allows other windows to be stacked on top."Windowed"
title
"<string>"
"Alacritty"
dynamic_title
true
| false
true
class
{ instance = "<string>", general = "<string>" }
general
is used as the app_id
.{ instance = "Alacritty", general = "Alacritty" }
decorations_theme_variant
"Dark"
| "Light"
| "None"
"None"
uses the system default."None"
resize_increments
true
| false
false
option_as_alt
"OnlyLeft"
| "OnlyRight"
| "Both"
| "None"
Option
key to behave as Alt
."None"
level
"Normal"
| "AlwaysOnTop"
AlwaysOnTop
keeps the window as a toplevel window."Normal"
[scrolling]
- Scrolling ConfigurationThis section documents the [scrolling]
table of the configuration file.
history
<integer>
0
disables scrolling. The value is limited to 100000
.10000
multiplier
<integer>
3
[font]
- Font ConfigurationThis section documents the [font]
table of the configuration file.
normal
{ family = "<string>", style = "<string>" }
monospace
on Linux/BSD, Consolas
on Windows, and Menlo
on macOS.bold
{ family = "<string>", style = "<string>" }
family
is not specified, it falls back to the normal
font's family.{ style = "Bold" }
italic
{ family = "<string>", style = "<string>" }
family
is not specified, it falls back to the normal
font's family.{ style = "Italic" }
bold_italic
{ family = "<string>", style = "<string>" }
family
is not specified, it falls back to the normal
font's family.{ style = "Bold Italic" }
size
<float>
11.25
offset
{ x = <integer>, y = <integer> }
y
modifies line spacing, and x
modifies letter spacing.{ x = 0, y = 0 }
glyph_offset
{ x = <integer>, y = <integer> }
x
moves the glyph right, and increasing y
moves it upward.builtin_box_drawing
true
| false
true
, Alacritty uses a custom built-in font for box drawing characters, legacy computing symbols, and powerline symbols.true
[colors]
- Color ConfigurationThis section documents the [colors]
table. Colors are specified using hexadecimal values with a #
prefix (e.g., #RRGGBB
).
primary
foreground
: Default is "#d8d8d8"
.background
: Default is "#181818"
.dim_foreground
: Default is "#828482"
. If not set, it is automatically calculated from the foreground color.bright_foreground
: Default is None
. Only used when draw_bold_text_with_bright_colors
is true
.cursor
{ text = "<string>", cursor = "<string>" }
CellForeground
/CellBackground
.{ text = "CellBackground", cursor = "CellForeground" }
vi_mode_cursor
{ text = "<string>", cursor = "<string>" }
{ text = "CellBackground", cursor = "CellForeground" }
selection
{ text = "<string>", background = "<string>" }
{ text = "CellBackground", background = "CellForeground" }
normal
black
: "#181818"
red
: "#ac4242"
green
: "#90a959"
yellow
: "#f4bf75"
blue
: "#6a9fb5"
magenta
: "#aa759f"
cyan
: "#75b5aa"
white
: "#d8d8d8"
bright
black
: "#6b6b6b"
red
: "#c55555"
green
: "#aac474"
yellow
: "#feca88"
blue
: "#82b8c8"
magenta
: "#c28cb8"
cyan
: "#93d3c3"
white
: "#f8f8f8"
draw_bold_text_with_bright_colors
true
| false
true
, bold text is drawn using the bright color variants.false
[keyboard]
- Keyboard ConfigurationThis section documents the [keyboard]
table.
bindings
[{ key = "<key>", mods = "<mods>", action = "<action>" | ... }, ...]
"ReceiveChar"
or "None"
.key
: The key name (e.g., "A"
, "F1"
) or a decimal scancode.mods
: Modifiers like "Control"
, "Shift"
, "Alt"
, which can be combined with |
.mode
: A terminal mode that must be active for the binding to trigger (e.g., "Vi"
, "Search"
).action
: A predefined action, such as Copy
, Paste
, or ToggleFullscreen
.chars
: A string to write to the terminal.command
: A command to execute.