Commit graph

1918 commits

Author SHA1 Message Date
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 ed35d033ae
Fix fullwidth char regex search infinite loop
This resolves an issue where the regex search could loop indefinitely
when the end point was defined in a location containing a fullwidth
character, thus skipping over the end before termination.

Fixes #5753.
2022-01-08 20:24:42 +00:00
a5ob7r 5aa8046c7f
Fix last column block selection
This fixes a regression introduced in 8e584099, where block selections
containing the last cell would have the trailing newline stripped and be
joined into one long line on copy.
2022-01-07 09:03:15 +00:00
David 50c7c2b469
Fix macOS IME regression
Fixes 5669.
2022-01-06 03:31:45 +00:00
Kirill Chibisov db83902319
Fix title setting via IPC when dynamic_title is enabled 2022-01-06 02:13:55 +03:00
Kirill Chibisov f7177101ed
Use builtin font for box drawing unicode characters
This commit adds hand rolled drawing of unicode box drawing[1] and
block elements[2] from ranges U+2500 up to U+259f. While using system
font for such characters will look better most of the time, the
characters tend to overlap or not align, so providing builtin font is
the lesser evil here.

[1] - https://www.unicode.org/charts/PDF/U2500.pdf
[2] - https://www.unicode.org/charts/PDF/U2580.pdf

Fixes #5485.
2022-01-06 00:45:06 +03:00
a5ob7r 2057ac243a
Trim \n from hints/semantic-/simple selection
Before this patch a hint regex ending in the last column would append a
newline, despite this newline being "invisible" to the user. To match
the expected behavior, newlines are trimmed from regex hint matches.

To ensure consistency the simple and semantic selection also do not
include a newline at the end of the copied text anymore.

Fixes #5697.
2022-01-04 21:46:20 +00:00
Christian Duerr 437f42f8d3
Migrate from structopt to clap 3 2022-01-04 18:25:26 +00:00
Kirill Chibisov 75c14b9bb8
Update wayland-client to v0.29.3
This should bring support for latest wayland.xml.
It also updates some other dependencies which are used by alacritty.

Fixes #5743.
2022-01-03 22:20:56 +00: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
Kirill Chibisov e2b5219eb4
Fix input lag with nvidia driver on Wayland
Fixes #5694.
2021-12-27 23:31:08 +02:00
Christian Duerr f0934d8440
Migrate to 2021 edition 2021-12-26 16:47:57 +00:00
Christian Duerr 850fd1826b
Bump development version to 0.11.0-dev
This is only an update to the development version and does not represent
a stable release.
2021-12-26 15:39:09 +00:00
Christian Duerr e0f8320c39
Fix test failures due to CLI parameters
Fixes #5717.
2021-12-25 19:32:54 +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
Jorge Carrasco f1802c1cda
Spawn children from foreground working directory
To allow applications spawned by Alacritty to make use of the
shell/foreground process' working directory, it is now set for all new
processes spawned by Alacritty on Unix platforms.

Fixes #5616.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-12-18 17:27:10 +00:00
a5ob7r cded85a2f2
Keep history position when viewport is cleared
This patch resolves a behavior that display area doesn't keep track of
content in a scrollback buffer due to display offset reset when viewport
clear is invoked.

This is similar to #5341, but this problem is caused by viewport clear
instead of new outputs to the viewport.
2021-12-18 15:36:56 +00:00
jeremycostanzo 8e58409930
Remove trailing whitespace from block selection
Fixes #5638.
2021-12-18 15:18:19 +00:00
fee1-dead 2538c87d3e
Remove outdated Rust compatibility code 2021-12-17 15:16:54 +00:00
Christian Duerr 3371851cbd
Update dependencies
This update includes crossfont 0.3.2, which updates the macOS font
fallback behavior.

Fixes #3271.
2021-12-11 10:12:06 +00:00
a5ob7r a1083d18ed
Fix vi cursor moving incorrectly with new output
This fixes an issue where the vi cursor would move down one line if it's
positioned at the topmost visible line, while at least partially scrolled
up into history, when new lines are added to the terminal.

This problem is caused by using a display offset of a grid not scrolled
yet when scrolling and determining a new vi cursor position.
2021-12-03 19:33:21 +00:00
a5ob7r 7e736c00f6
Fix crash when vi cursor in history during clear
Fixes #5544.
2021-12-03 07:45:05 +00: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 c89939b5d1
Switch to clap-generated completions
The current completions required a lot of domain-specific knowledge
about each individual shell and their completion functionality. Much of
which is sparsely documented.

While clap does not generate perfect completions, since parameters like
`-e` are missing completions, it does a reasonable job while requiring
no work on writing these completions.

Since access to `cli.rs` isn't possible from the `build.rs`, these
completions aren't always generated on build. Instead a test verifies
that there has been no changes to these completions and provides a
simple code sample for re-generating them. This should provide a simple
solution with minimal overhead.
2021-11-19 23:34:40 +00:00
James McCoy b0da035e9e
Update signal-hook to 0.3.10 2021-11-15 00:56:27 +00:00
Scott Freeman e648aae0eb
Fix crash with empty post-processed matches
Fixes #5492.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-11-11 19:04:25 +00:00
Christian Duerr b885ec9cd3
Add alacritty-msg manpage to documentation
The original multiwindow PR added a new manpage, however this was not
properly documented or included in our CI. This patch resolves these
issues.
2021-11-08 23:22:09 +00:00
Diego Garza 33db289f7f
Fix libxkbcommon-devel package name for openSUSE
Fixes #5586.
2021-11-02 21:32:53 +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
Christian Duerr d8a98f8829
Fix cursor inversion logic
The existing cursor inversion logic was causing more problems than it
solved, without solving the problem of invisible cursor when inverting a
cell with matching foreground and background colors.

This patch reworks this logic and only inverts the cursor when the
foreground and background colors of the cursor are similar and the
cursor colors aren't set to fixed RGB values.

Fixes #4564.
Fixes #5550.
2021-10-22 06:33:34 +00:00
Christian Duerr f90dd12efd
Update rustfmt configuration
In this change I went through all current rustfmt configuration options
and expanded our existing configuration with overrides whenever deemed
appropriate.

The `normalize_doc_attributes` option is still unstable, but seems to
work without any issues. Even when passing macros like `include_str!`
that is recognized properly and not normalized. So while this wasn't an
issue anywhere in the code, it should make sure it never will be.

When it comes to imports there are two new major additions. The
`imports_granularity` and `group_imports` options. Both mostly just
incorporate unwritten rules that have existed in Alacritty for a long
time. Unfortunately since `alacritty_terminal` imports in `alacritty`
are supposed to be separate blocks, the `group_imports` option cannot be
used.
2021-10-11 00:54:18 +00:00
Alexis Hildebrandt ec4dc32688
Fix typo in makefile 2021-10-03 17:51:34 +00:00
Christian Duerr 8cda3d1405
Fix incorrect vi mode search origin
Fixes #5460.
2021-09-28 08:30:41 +00:00
Christian Duerr b6e05d2dce
Fix vi indicator obstructing vi mode cursor
Fixes #5504.
2021-09-27 03:51:58 +00:00
Ilya Bobyr 58985a4dcb
Handle PTY EIO error for Rust 1.55+
`ErrorKind::Other` no longer includes `EIO` since Rust 1.55:

    https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html#stdioerrorkind-variants-updated

It was not precise enough from the very beginning, as the comment says
that only EIO should be hidden, while the code was any uncategorised
errors.
2021-09-19 01:21:34 +00:00
Jonathan V fb1b7f6007
Add python to Archlinux install instructions 2021-09-17 20:53:16 +00:00
Christian Duerr c96047dc73
Remove unused struct fields
While it might be nice to have the full `Passwd` struct around should
anything ever change in the future, there's really no reason why
Alacritty would need this information. So just removing things for now
makes more sense than adding `#[allow(unused)]`.
2021-09-15 21:13:49 +00:00
Christian Duerr 990f3f81f0
Add libxkbcommon-dev to openSUSE dependencies 2021-09-14 19:47:00 +00:00
Christian Duerr cf35a20191
Remove custom merge strategy for changelog
While the custom merge strategy can make things simpler in some
scenarios, it has repeatedly shown to silently introduce errors that
have to be manually spotted and corrected after the fact.

It's much more reliable and efficient to always manually oversee
potential conflicts, rather than letting them slip through half of the
time and having to contribute follow-up patches.
2021-08-27 22:11:20 +00:00
Naïm Favier 70d3b4ef6c
Watch non-canonical path for config symlinks
To make it possible to detect the replacement of the configuration file
when it is a symlink, the symlinks path has to be observed in addition
to the canonicalized path. That way changes to either file will trigger
a live config reload.

Multiple layers of symlinks would still not get detected when any
symlink other than the configuration file itself is replaced, but this
patch should cover most realistic usage scenarios.
2021-08-27 21:30:39 +00:00
Andrew Chin e6565f1b76
Fix alacitty_terminal build on windows
The "consoleapi" feature in the winapi crate is required when using
things from the `winapi::um::consoleapi` module.
2021-08-26 22:01:18 +00:00
Christian Duerr ed76efe9c0
Fix 'background_opacity' deprecation
During the deprecation of the 'background_opacity' field, it was
incorrectly renamed to 'window_opacity'. This changes that back to ensure
the old field still works and a warning is emitted accordingly.

See the original regression here:
c24d7dfd0d (diff-f92f0b1ad70a7b75b7266f3c9e569025e023d186814aa88c2b690800850ccb78L72-R73)

Fixes #5437.
2021-08-23 18:47:34 +03:00
Christian Duerr 62a1fad524
Migrate CLI config to structopt
While structopt also uses clap under the hood, the configuration through
annotations allows for significantly more maintainable and concise CLI
definition.

This will also make it far easier to have platform-specific options,
which is problematic with clap since no individual methods can be
removed from its builder.

The change in Alacritty's CLI has been kept to a minimum with the only
significant changes being the `--version` flag listed before the
`-v` flag and the authors all on the same line.
2021-08-18 09:36:51 +00:00
Christian Duerr abed2e9748
Add macOS ARM builds to CI 2021-08-17 18:04:46 +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
yancyribbens 9a8ae43c0a
Add python3 dep to freebsd install instructions 2021-08-15 15:55:32 +00:00
Steven Bosnick d5c66ceeac
Log dependency warnings/errors at trace level
Fixes #5387.
2021-08-04 01:00:18 +00:00
Christian Duerr fd0fe967a3
Fix fullwidth character crash on resize
Fixes #5383.
2021-08-01 21:14:17 +00:00