Commit Graph

15 Commits

Author SHA1 Message Date
Christian Duerr 4ddb608563
Add IPC config subcommand
This patch adds a new mechanism for changing configuration options
without editing the configuration file, by sending options to running
instances through `alacritty msg`.

Each window will load Alacritty's configuration file by default and then
accept IPC messages for config updates using the `alacritty msg config`
subcommand. By default all windows will be updated, individual windows
can be addressed using `alacritty msg config --window-id
"$ALACRITTY_WINDOW_ID"`.

Each option will replace the config's current value and cannot be reset
until Alacritty is restarted or the option is overwritten with a new
value.

Configuration options are passed in the format `field.subfield=value`,
where `value` is interpreted as yaml.

Closes #472.
2022-09-01 01:48:38 +03:00
trimental 376300385b
Use `WindowEvent::Occluded` to hint rendering
This should prevent rendering on macOS and X11 to invisible
windows.
2022-08-11 13:06:19 +04:00
Kirill Chibisov b86667b298
Remove redundant dirty updates
In some cases dirty was set without any ui update leading
to extra redraws, this commit resolves this.

Co-authored-by: Greg Depoire--Ferrer <greg@gregdf.com>
2022-07-25 02:17:57 +03: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 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
Kirill Chibisov 90552e3e7f
Fix flickering during resize on Wayland
This also fixes an issue of windows not being rendered while resizing.

Fixes #6069.
2022-06-09 16:31:08 +00:00
Kirill Chibisov 673710487a
Extract `SizeInfo` from alacritty_terminal
The `SizeInfo` is a SizeInfo used for rendering, which contains
information about padding, and such, however all the terminal need is
number of visible lines and columns.
2022-04-06 13:06:39 +03:00
Kirill Chibisov 4734b2b850
Don't load font twice during display creation
This commit finishes the effort from a64553b to avoid reloading font
twice during startup, since the original issue is with getting font
metrics without building the glyph cache.
2022-02-18 01:27:10 +03:00
Kirill Chibisov db83902319
Fix title setting via IPC when dynamic_title is enabled 2022-01-06 02:13:55 +03:00
Kirill Chibisov ce59fa4165
Add title/class CLI parameters to create-window
This adds the ability to pass title and class over IPC via the
create-window subcommand, so users can run only one instance for windows
of different spurposes in the window managers of their choice.
2022-01-03 18:55:22 +00:00
Christian Duerr 3af1940192
Fix CreateNewWindow CLI fallback
The existing behavior for the new CreateNewWindow actions was to always
pass in their own options, which would discard the existing options
configured on the terminal's PTY config.

To fix this the behavior for CreateNewWindow is now the same as for the
initial window creation, the config values are overwritten conditionally
based on their individual presence in the CLI options.

However all temporary CLI options set on the "master" Alacritty
instance are discarded by all future windows.

Fixes #5659.
2021-12-23 12:23:06 +02:00
Christian Duerr 6d1a63ef28
Remove shared PID/FD variables
The existing PID/FD atomics in alacritty_terminal/src/tty/unix.rs were
shared across all Alacritty windows, causing problem with the new
multiwindow feature.

Instead of sharing these between the different windows, the master FD
and shell PID are now stored on the `window_context`.

Unfortunately this makes spawning new daemons a little more complicated,
having to pass through additional parameters. To ease this a little bit
the helper method `spawn_daemon` has been defined on the
`ActionContext`, making it accessible from most parts of Alacritty's
event loop.

Fixes #5700.
2021-12-19 01:18:42 +03:00
Kirill Chibisov 4c6a763850
Bump glutin to 0.28.0
Fixes #5603.
Fixes #5422.
Fixes #5350.
Fixes #4105.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-12-03 03:50:14 +00:00
Kirill Chibisov 8681f71084
Add parameters to `msg create-window` subcommand
Alacritty's `msg create-window` subcommand would previously inherit all
the CLI parameters from the original executable. However not only could
this lead to unexpected behavior, it also prevents multi-window users
from making use of parameters like `-e`, `--working-directory`, or
`--hold`.

This is solved by adding a JSON-based message format to the IPC socket
messages which instructs the Alacritty server on which CLI parameters
should be used to create the new window.

Fixes #5562.
Fixes #5561.
Fixes #5560.
2021-11-22 18:34:09 +00: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