1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00
alacritty/docs/features.md
Christian Duerr 1df7dc5171
Add multi-window support
Previously Alacritty would always initialize only a single terminal
emulator window feeding into the winit event loop, however some
platforms like macOS expect all windows to be spawned by the same
process and this "daemon-mode" can also come with the advantage of
increased memory efficiency.

The event loop has been restructured to handle all window-specific
events only by the event processing context with the associated window
id. This makes it possible to add new terminal windows at any time using
the WindowContext::new function call.

Some preliminary tests have shown that for empty terminals, this reduces
the cost of additional terminal emulators from ~100M to ~6M. However at
this point the robustness of the daemon against issues with individual
terminals has not been refined, making the reliability of this system
questionable.

New windows can be created either by using the new `CreateNewWindow`
action, or with the `alacritty msg create-window` subcommand. The
subcommand sends a message to an IPC socket which Alacritty listens on,
its location can be found in the `ALACRITTY_SOCKET` environment
variable.

Fixes #607.
2021-10-23 07:16:47 +00:00

3.6 KiB

Features

This document gives an overview over Alacritty's features beyond its terminal emulation capabilities. To get a list with supported control sequences take a look at Alacritty's escape sequence support.

Vi Mode

The vi mode allows moving around Alacritty's viewport and scrollback using the keyboard. It also serves as a jump-off point for other features like search and opening URLs with the keyboard. By default you can launch it using Ctrl Shift Space.

Motion

The cursor motions are setup by default to mimic vi, however they are fully configurable. If you don't like vi's bindings, take a look at the configuration file to change the various movements.

Selection

One useful feature of vi mode is the ability to make selections and copy text to the clipboard. By default you can start a selection using v and copy it using y. All selection modes that are available with the mouse can be accessed from vi mode, including the semantic (Alt v), line (Shift v) and block selection (Ctrl v). You can also toggle between them while the selection is still active.

Search allows you to find anything in Alacritty's scrollback buffer. You can search forward using Ctrl Shift f and backward using Ctrl Shift b.

In vi mode the search is bound to / for forward and ? for backward search. This allows you to move around quickly and help with selecting content. The SearchStart and SearchEnd keybinding actions can be bound if you're looking for a way to jump to the start or the end of a match.

During normal search you don't have the opportunity to move around freely, but you can still jump between matches using Enter and Shift Enter. After leaving search with Escape your active match stays selected, allowing you to easily copy it.

Hints

Terminal hints allow easily interacting with visible text without having to start vi mode. They consist of a regex that detects these text elements and then either feeds them to an external application or triggers one of Alacritty's built-in actions.

Hints can also be triggered using the mouse or vi mode cursor. If a hint is enabled for mouse interaction and recognized as such, it will be underlined when the mouse or vi mode cursor is on top of it. Using the left mouse button or Enter key in vi mode will then trigger the hint.

Hints can be configured in the hints and colors.hints sections in the Alacritty configuration file.

Selection expansion

After making a selection, you can use the right mouse button to expand it. Double-clicking will expand the selection semantically, while triple-clicking will perform line selection. If you hold Ctrl while expanding the selection, it will switch to the block selection mode.

Opening URLs with the mouse

You can open URLs with your mouse by clicking on them. The modifiers required to be held and program which should open the URL can be setup in the configuration file. If an application captures your mouse clicks, which is indicated by a change in mouse cursor shape, you're required to hold Shift to bypass that.

Multi-Window

Alacritty supports running multiple terminal emulators from the same Alacritty instance. New windows can be created either by using the CreateNewWindow keybinding action, or by executing the alacritty msg create-window subcommand.