1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00
alacritty/INSTALL.md
Zac Pullar-Strecker 863d5581a6 Document that alacritty requires winpty-agent on windows
To make things easier to understand for Windows users, the 
relationship between Alacritty and the WinPTY agent has been
clarified in the documentation.

This also bundles the windows agent and exe together in a zip file to
make distribution for windows easier on the user.
2019-02-02 12:00:29 +00:00

7.9 KiB

Manual Installation

  1. Prerequisites
    1. Source Code
    2. Rust Compiler
    3. Dependencies
      1. Debian/Ubuntu
      2. Arch Linux
      3. Fedora
      4. CentOS/RHEL 7
      5. openSUSE
      6. Slackware
      7. Void Linux
      8. FreeBSD
      9. OpenBSD
      10. Solus
      11. NixOS/Nixpkgs
      12. Gentoo
      13. Windows
      14. Other
  2. Building
    1. Linux
      1. Desktop Entry
    2. MacOS
    3. Cargo
    4. Debian/Ubuntu
  3. Manual Page
  4. Shell Completions
    1. Zsh
    2. Bash
    3. Fish
  5. Terminfo

Prerequisites

Clone the source code

Before compiling Alacritty, you'll have to first clone the source code:

git clone https://github.com/jwilm/alacritty.git
cd alacritty

Install the Rust compiler with rustup

  1. Install rustup.rs.

  2. To make sure you have the right Rust compiler installed, run

    rustup override set stable
    rustup update stable
    

Dependencies

Debian/Ubuntu

You can build alacritty using cargo deb and use your system's package manager to maintain the application using the instructions above.

If you'd still like to build a local version manually, you need a few extra libraries to build Alacritty. Here's an apt command that should install all of them. If something is still found to be missing, please open an issue.

apt-get install cmake pkg-config libfreetype6-dev libfontconfig1-dev xclip

Arch Linux

On Arch Linux, you need a few extra libraries to build Alacritty. Here's a pacman command that should install all of them. If something is still found to be missing, please open an issue.

pacman -S cmake freetype2 fontconfig pkg-config make xclip

Fedora

On Fedora, you need a few extra libraries to build Alacritty. Here's a dnf command that should install all of them. If something is still found to be missing, please open an issue.

dnf install cmake freetype-devel fontconfig-devel xclip

CentOS/RHEL 7

On CentOS/RHEL 7, you need a few extra libraries to build Alacritty. Here's a yum command that should install all of them. If something is still found to be missing, please open an issue.

yum install cmake freetype-devel fontconfig-devel xclip
yum group install "Development Tools"

openSUSE

On openSUSE, you need a few extra libraries to build Alacritty. Here's a zypper command that should install all of them. If something is still found to be missing, please open an issue.

zypper install cmake freetype-devel fontconfig-devel xclip

Slackware

Compiles out of the box for 14.2 For copy & paste support (middle mouse button) you need to install xclip https://slackbuilds.org/repository/14.2/misc/xclip/?search=xclip

Void Linux

On Void Linux, install following packages before compiling Alacritty:

xbps-install cmake freetype-devel freetype expat-devel fontconfig-devel fontconfig xclip

FreeBSD

On FreeBSD, you need a few extra libraries to build Alacritty. Here's a pkg command that should install all of them. If something is still found to be missing, please open an issue.

pkg install cmake freetype2 fontconfig xclip pkgconf

OpenBSD

Alacritty builds on OpenBSD 6.3 almost out-of-the-box if Rust and Xenocara are installed. If something is still found to be missing, please open an issue.

pkg_add rust

Solus

On Solus, you need a few extra libraries to build Alacritty. Here's a eopkg command that should install all of them. If something is still found to be missing, please open an issue.

sudo eopkg install fontconfig-devel

NixOS/Nixpkgs

The following command can be used to get a shell with all development dependencies on NixOS.

nix-shell -A alacritty '<nixpkgs>'

Windows

On windows you will need to have the {architecture}-pc-windows-msvc toolchain installed as well as Clang 3.9 or greater.

Other

If you build Alacritty on another distribution, we would love some help filling in this section of the README.

Building

Linux / Windows

Once all the prerequisites are installed, compiling Alacritty should be easy:

cargo build --release

If all goes well, this should place a binary at target/release/alacritty. On Windows this directory should also contain the winpty-agent.exe.

Desktop Entry

Many linux distributions support desktop entries for adding applications to system menus. To install the desktop entry for Alacritty, run

sudo cp target/release/alacritty /usr/local/bin # or anywhere else in $PATH
sudo desktop-file-install alacritty.desktop
sudo update-desktop-database

MacOS

To build an application for macOS, run

make app
cp -r target/release/osx/Alacritty.app /Applications/

Cargo

If you don't want to clone the repository, you can install Alacritty directly using cargo:

cargo install --git https://github.com/jwilm/alacritty

Debian/Ubuntu

Using cargo deb, you can create and install a deb file.

cargo install cargo-deb
cargo deb --install

To choose a default terminal app, use Debian's update-alternatives.

update-alternatives --config x-terminal-emulator

Manual Page

Installing the manual page requires the additional dependency gzip. To install the manual page, run

sudo mkdir -p /usr/local/share/man/man1
gzip -c alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null

Shell completions

To get automatic completions for alacritty's flags and arguments you can install the provided shell completions.

Zsh

To install the completions for zsh, you can place the alacritty-completions.zsh as _alacritty in any directory referenced by $fpath.

If you do not already have such a directory registered through your ~/.zshrc, you can add one like this:

mkdir -p ${ZDOTDIR:-~}/.zsh_functions
echo 'fpath+=${ZDOTDIR:-~}/.zsh_functions' >> ${ZDOTDIR:-~}/.zshrc

Then copy the completion file to this directory:

cp alacritty-completions.zsh ${ZDOTDIR:-~}/.zsh_functions/_alacritty

Bash

To install the completions for bash, you can source the alacritty-completions.bash in your ~/.bashrc file.

If you do not plan to delete the source folder of alacritty, you can run

echo "source $(pwd)/alacritty-completions.bash" >> ~/.bashrc

Otherwise you can copy it to the ~/.bash_completion folder and source it from there:

mkdir -p ~/.bash_completion
cp alacritty-completions.bash ~/.bash_completion/alacritty
echo "source ~/.bash_completion/alacritty" >> ~/.bashrc

Fish

To install the completions for fish, run

sudo cp alacritty-completions.fish $__fish_datadir/vendor_completions.d/alacritty.fish

Terminfo

The terminfo database contains entries describing the terminal emulator's capabilities. Programs need these in order to function properly.

Alacritty should work with the standard xterm-256color definition, but to allow programs to make best use of alacritty's capabilities, use its own terminfo definition instead.

Unless the user has set the TERM environment variable in the alacritty configuration, the alacritty terminfo definition will be used if it has been installed. If not, then xterm-256color is used instead.

To install alacritty's terminfo entry globally:

sudo tic -e alacritty,alacritty-direct alacritty.info