Commit Graph

8 Commits

Author SHA1 Message Date
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