Commit graph

191 commits

Author SHA1 Message Date
Philip Taron df32b5216b
Fix VirtualKeyCode config documentation
The `winit` crate was split off of the `glutin` crate. This patch fixes
the config link to correctly point to the winit enum instead of the old
glutin reexport.
2022-12-02 22:20:40 +00:00
Kirill Chibisov 2d619850ae
Add 'debug.renderer' config option
This should help trouble shooting the renderer being created and
different renderer options to determine when something like dual-source
rendering isn't working.
2022-11-28 13:12:53 +03:00
Kirill Chibisov 7d708d53f7
Bump glutin to 0.29.1
Fixes #6239.
Fixes #5975.
Fixes #5876.
Fixes #5767.
Fixes #4484.
Fixes #3139.
2022-08-10 16:48:46 +04:00
Sabu Siyad 76c5d01ee2
Warn if only columns XOR lines is set
Co-authored-by: Christian Duerr <contact@christianduerr.com>
2022-08-02 20:43:37 +00:00
Chris Copeland c3f3bd3666
Register Alacritty shells as tty sessions on macOS
Unless the `shell` config is specified, launch the user's shell with:

```sh
login -flp $USER /bin/sh -c "exec -a -shell /path/to/shell"
```

On macOS, just running a shell prefixed by `-` is not sufficient to be
registered as a login session for things like `w` and `logname`.
However, using the `login` command changes the directory to `$HOME`
before running the program by default, which is not desired. The `-l`
flag disables this behavior, but also skips prepending `-` to the
executed program, so shells will not run as login shells. Instead we
just do this part ourselves with `exec -a`. The result is login shells
that run in the intended directory and are registered as tty sessions.

Fixes #3420.
2022-07-24 02:51:16 +00:00
Chris Copeland 2a676dfad8
Fix thin strokes on macOS
Remove the `font.use_thin_strokes` config, which only did anything on
macOS and only prior to Big Sur. Instead, we will enable or disable
"font smoothing" on macOS based on the `AppleFontSmoothing` user
default.

These changes let users get the "thin strokes" behavior by setting
`AppleFontSmoothing` to 0 with:

```sh
$ defaults write -g AppleFontSmoothing -int 0
```

(Or replace `-g` with `org.alacritty` to apply this setting only to
Alacritty.app, rather than the whole system.)

Add a `removed` config attribute to show helpful warnings to users
who are using config options that don't do anything anymore, and apply
this attribute to `font.use_thin_strokes`.

Bump `crossfont` to 0.5.0 to pick up the new font smoothing behavior.
This release also includes a fix for a crash when trying to load a
disabled font.

Fixes #4616.
Fixes #6108.
2022-07-15 21:56:26 +00:00
Kirill Chibisov 694a52bcff
Add support for hyperlink escape sequence
This commit adds support for hyperlink escape sequence
`OSC 8 ; params ; URI ST`. The configuration option responsible for
those is `hints.enabled.hyperlinks`.

Fixes #922.
2022-07-10 20:11:28 +03:00
Kirill Chibisov ebc6922eaa
Add cursor.blink_timeout config option
This option should prevent extensive power usage due to cursor blinking
when there's no user activity being performed.

Fixes #5992.
2022-07-01 11:40:27 +03:00
jeremycostanzo fdcf99b0c1
Add vi action to center view around vi cursor 2022-06-10 00:08:18 +03:00
a5ob7r ad3ebba532
Remove unnecessary commas in config keybindings 2022-04-29 01:24:35 +00:00
Kirill Chibisov 8f1abe13e6
Add damage tracking and reporting to compatible compositors
This allows compositors to only process damaged (that is, updated)
regions of our window buffer, which for larger window sizes (think 4k)
should significantly reduce compositing workload under compositors that
support/honor it, which is good for performance, battery life and lower
latency over remote connections like VNC.

On Wayland, clients are expected to always report correct damage, so
this makes us a good citizen there. It can also aid remote desktop
(waypipe, rdp, vnc, ...) and other types of screencopy by having damage
bubble up correctly.

Fixes #3186.
2022-02-02 00:12:58 +03:00
zandr 094c2c9269
Add option to control built-in box drawing chars
This commit adds the config `font.builtin_box_drawing` option to
control built-in font, which is enabled by default.
2022-01-29 22:50:44 +03:00
Kirill Chibisov 5e39ea9f9f
Fix block selection expansion with Ctrl + RMB
When 'ExpandSelection' binding was added only default binding for
RightClick was added, however to expand block selection holding control
when doing a click is required, so this commit adds a binding for
'RMB + Control'.
2022-01-11 00:56:49 +03:00
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
Kirill Chibisov c24d7dfd0d
Add option to apply opacity to all background colors
In some cases it could be desired to apply 'background_opacity'
to all background colors instead of just 'colors.primary.background',
thus adding an 'colors.opaque_background_colors' option to control that.

Fixes #741.
2021-08-16 14:49:14 +03:00
Jason Heard 3c309a0953
Add ExpandSelection mouse binding action
Fixes #4132.
2021-07-29 15:40:51 +00:00
a5ob7r 72675db382
Fix leaving vi mode with active selection
This bug comes from 530de00049. The vi
cursor movement changes text selection range when it is on vi mode. On
the other hand the cursor movement doesn't change the range when it
isn't on vi mode. So preserve text selection range by toggling vi mode
early.
2021-07-07 22:05:05 +00:00
Joshua Ortiz 7e4325796d
Add modes to regex hint bindings
Fixes #5154.
2021-06-19 22:58:15 +00:00
Alfonso Montero c17d8db169
Add ipfs/ipns URL scheme support 2021-05-21 23:09:06 +00:00
Mark Stosberg 4d7889acbd
Fix typo in config documentation 2021-05-20 19:29:59 +00:00
Christian Duerr 38bab815fe
Add magnet URL support to config docs
Support for magnet URLs was introduced in 78e0444, however that commit
failed to document things in the alacritty.yml file.
2021-05-19 09:01:31 +00:00
Christian Duerr d94c1e97a8
Fix URL highlighting with unicode whitespace
The URL highlighting regex would automatically terminate on an ascii
whitespace, however there are several other forms of whitespace that are
indistinguisable to a user from normal whitespace. To make things a
little more intuitive, all unicode whitespace will now terminate URLs.
2021-05-09 22:33:51 +00:00
Nathan Lilienthal e3818a226c
Use cell colors for focused match CellRgb
Fixes #5022.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-04-30 22:16:48 +00:00
Nathan Lilienthal 11cbc439c8 Update vi-mode Open config docs for hints 2021-04-26 19:10:00 -04:00
Christian Duerr 1f46bb7b92
Add hint action for moving the vi cursor
Fixes #4319.
2021-04-15 21:25:49 +00:00
Christian Duerr 96fc9ecc9a
Add vi/mouse hint highlighting support
This patch removes the old url highlighting code and replaces it with a
new implementation making use of hints as sources for finding matches in
the terminal.
2021-04-13 03:24:42 +00:00
Kam Kudla 40bcdb1133
Add hide other windows binding on macOS
Fixes #3697.
2021-04-08 21:01:47 +00:00
Christian Duerr cbcc129440
Add copy/paste/select hint actions
This adds some built-in actions for handling hint selections without
having to spawn external applications.

The new actions are `Copy`, `Select` and `Paste`.
2021-04-03 23:52:44 +00:00
Serban Constantin 17923efccf
Fix URLs opening in explorer on Windows 2021-03-15 14:27:57 +00:00
Christian Duerr a954e076ca
Add regex terminal hints
This adds support for hints, which allow opening parts of the visual
buffer with external programs if they match a certain regex.

This is done using a visual overlay triggered on a specified key
binding, which then instructs the user which keys they need to press to
pass the text to the application.

In the future it should be possible to supply some built-in actions for
Copy/Pasting the action and using this to launch text when clicking on
it with the mouse. But the current implementation should already be
useful as-is.

Fixes #2792.
Fixes #2536.
2021-03-01 19:50:39 +00:00
Christian Duerr a1e2d6a557
Add vi/search line indicator
This adds a new visual indicator which shows the position in history of
either the display offset during search, or the vi mode cursor.

To make it as unintrusive as possible, the overlay is hidden whenever
the vi mode cursor collides with its position.

Fixes #3984.
2021-01-01 05:19:03 +00:00
Christian Duerr 8ed72cc065
Remove Windows WinPTY backend 2021-01-01 05:07:39 +00:00
Christian Duerr 0aa1df327b
Add default binding to cancel search on Ctrl+C
Fixes #4612.
2020-12-31 05:33:58 +00:00
Christian Duerr 6e1b9d8b25
Replace serde's derive with custom proc macro
This replaces the existing `Deserialize` derive from serde with a
`ConfigDeserialize` derive. The goal of this new proc macro is to allow
a more error-friendly deserialization for the Alacritty configuration
file without having to manage a lot of boilerplate code inside the
configuration modules.

The first part of the derive macro is for struct deserialization. This
takes structs which have `Default` implemented and will only replace
fields which can be successfully deserialized. Otherwise the `log` crate
is used for printing errors. Since this deserialization takes the
default value from the struct instead of the value, it removes the
necessity for creating new types just to implement `Default` on them for
deserialization.

Additionally, the struct deserialization also checks for `Option` values
and makes sure that explicitly specifying `none` as text literal is
allowed for all options.

The other part of the derive macro is responsible for deserializing
enums. While only enums with Unit variants are supported, it will
automatically implement a deserializer for these enums which accepts any
form of capitalization.

Since this custom derive prevents us from using serde's attributes on
fields, some of the attributes have been reimplemented for
`ConfigDeserialize`. These include `#[config(flatten)]`,
`#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute
is currently limited to at most one per struct.

Additionally the `#[config(deprecated = "optional message")]` attribute
allows easily defining uniform deprecation messages for fields on
structs.
2020-12-21 02:44:38 +00:00
Christian Duerr f016a209b4
Add search history support
This adds a history to the regex search limited to at most 255 entries.
Whenever a search is either confirmed or cancelled, the last regex is
entered into the history and can be accessed when a new search is
started.

This should help users recover complicated search regexes after
accidentally discarding them, or handle repeated searches with the same
regexes.

Fixes #4095.
2020-12-20 04:27:08 +00:00
Christian Duerr 8a7f8c9d3e
Add separate mode for search bindings 2020-12-19 04:07:20 +00:00
Dettorer 2fd2db4afa
Add blinking cursor support
This adds support for blinking the terminal cursor. This can be
controlled either using the configuration file, or using escape
sequences.

The supported control sequences for changing the blinking state are
`CSI Ps SP q` and private mode 12.
2020-11-23 23:11:03 +00:00
Christian Duerr 07cfe8bbba
Add support for '~/' in config imports
This allows the configuration file imports to start with '~/' and
resolve relative to the user's home directory.

There is no support for '~user/' or '$HOME/' or any other shell
expansion. However since paths relative to the home directory should be
sufficient for everything, this provides a very simple solution without
any significant drawbacks.

Fixes #4157.
2020-11-24 00:37:34 +03:00
James Simpson c1f0e83cbb
Ignore nonexistent config imports instead of raising an error
Fixes: #4330.
2020-11-19 17:52:58 +03:00
Christian Duerr 9a78449876
Add ability to select text during search
This removes the restriction of not being able to select text while the
search is active, making it a bit less jarring of a UX when the user
tries to interact with the terminal during search.

Since the selection was used during vi-less search to highlight the
focused match, there is now an option for a focused match color, which
uses the inverted normal match color by default. This focused match is
used for both search modes.

Other mouse interactions are now also possible during search, like
opening URLs or clicking inside of mouse mode applications.
2020-11-13 08:40:09 +03:00
Christian Duerr 5fd792fc9b
Fix configuration file formatting
The configuration file, especially the section documenting the different
binding actions, had some extremely long lines. All the text is now
reformatted to be at most 80 columns wide.

The only lines remaining which are beyond 80 columns wide are the
configuration bindings, which would significantly suffer from linebreaks
and are not plain text.
2020-11-07 05:17:32 +00:00
Christian Duerr 9028fb451a
Fix visual bell getting stuck
This resolves a problem with the visual bell where it would not
automatically trigger a redraw itself after the initial frame has been
rendered.

Since the unit of the visual bell duration is also unclear, it has been
clarified.
2020-10-30 09:22:13 +03:00
Kirill Chibisov 67db9b228d
Bump glutin to 0.25.0
Fixes #4206.
Fixes #4162.
Fixes #4017.
Fixes #3998.
Fixes #3831.
Fixes #3782.
Fixes #3708.
Fixes #2734.
Fixes #2714.
Fixes #1801.
2020-10-07 17:40:50 +03:00
ii41 a754d06b44
Add support for single line terminals
This changes the minimum terminal dimensions from 2 lines and 2 columns,
to 1 line and 2 columns.

This also reworks the `SizeInfo` to store the number of columns and
lines and consistently has only the terminal lines/columns stored,
instead of including the message bar and search in some places of the
Alacritty renderer/input.

These new changes also make it easy to properly start the selection
scrolling as soon as the mouse is over the message bar, instead of
waiting until it is beyond it.

Fixes #4207.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-09-27 22:36:08 +00:00
Christian Duerr 3c3e6870de
Add configuration file imports
This adds the ability for users to have multiple configuration files
which all inherit from each other.

The order of imports is chronological, branching out to the deepest
children first and overriding every field with that of the configuration
files that are loaded at a later point in time.

Live config reload watches the directories of all configuration files,
allowing edits in any of them to update Alacritty immediately. While the
imports are live reloaded, a new configuration file watcher will only be
spawned once Alacritty is restarted.

Since this might cause loops which would be very difficult to detect, a
maximum depth is set to limit the recursion possible with nested
configuration files.

Fixes #779.
2020-08-21 18:48:48 +03:00
Christian Duerr 424791842f
Add Vi to available binding modes 2020-08-12 10:37:54 +03:00
Christian Duerr 4b516c6365
Add ^C binding to cancel search and leave Vi mode
Fixes #4089.
2020-08-10 01:57:55 +03:00
David de84ab2072
Fix typo in example config file 2020-08-03 18:28:41 +00:00
Mark Stosberg bfdfe2b0dd
Document keybinding actions 2020-08-02 22:42:17 +00:00
Joshua Steele 5c8aa679ae
Fix configuration file documentation 2020-08-01 11:16:12 +00:00