Commit Graph

950 Commits

Author SHA1 Message Date
Zac Pullar-Strecker 15e0deae2b Add support for Windows (#1374)
Initial support for Windows is implemented using the winpty translation
layer. Clipboard support for Windows is provided through the `clipboard`
crate, and font rasterization is provided by RustType.

The tty.rs file has been split into OS-specific files to separate
standard pty handling from the winpty implementation.

Several binary components are fetched via build script on windows
including libclang and winpty. These could be integrated more directly
in the future either by building those dependencies as part of the
Alacritty build process or by leveraging git lfs to store the artifacts.

Fixes #28.
2018-10-16 10:02:52 -07:00
RunningDroid b41c6b736d Add statusline capabilities to Terminfo 2018-10-14 22:23:54 +00:00
Christian Duerr cb6e0653fa
Extract manual installation instructions
Alacritty's manual installation instructions take up a lot of space in
the README and they are hard to navigate because there's a lot of
information for specific distros which are irrelevant to most users.

To improve this situation, the manual installation section has been
moved to the `INSTALL.md` file. This allows keeping the readme to a
minimum which just includes the straight-forward instructions required
to install it on systems which provide packages for it.

Having a separate file also makes it possible to add a full index just
for the installation instructions, which makes it possible to skip
sections which are irrelevant.
2018-10-14 21:01:09 +00:00
Robert Martin Winterstein d2ed0152f1 fix erroneous indexed_color results 2018-10-07 21:10:58 +00:00
Christian Duerr 36920fb071
Fix invalid default config
Serde has problems deserializing yaml files which contain sections
without any values. Since the `TERM` setting has been removed recently,
the `env` section was completely empty leading to deserialization
errors.

To resolve this the `env` section has been commented-out by default, if
the user wants to set a variable, it is now necessary to uncomment that
section.

Some minor tweaks have also been made to the existing `TERM` comments,
to clearly indicate these are value examples instead of comments.
2018-10-07 18:40:58 +00:00
Joe Wilm 44909bae69 Version 0.2.1 2018-10-03 08:13:14 -07:00
Tobias Sette 64a7ca60f5 Add additional documentation to "background_opacity" option 2018-10-03 11:29:37 +00:00
Matthias Bussonnier 24533d2c5d Make the macOS bundle compatible osx 10.12
On macOS 10.12.6, running `make app` creates a bundle that refuses to
start (it complains application is only compatible with more recent
versions of macOS). The binary works great when running it directly.

To resolve this, the `MACOSX_DEPLOYMENT_TARGET` environment
variable is now set automatically from the makefile. This allows
building on macOS 10.12 and earlier, without negatively impacting the
later versions of macOS.
2018-10-03 01:38:03 +00:00
trimental b22999f1e7 Drop terminal lock before rendering
The terminal lock is now dropped before rendering by storing
all grid cells before clearing the screen.

This frees the terminal to do other things since the lock is now
free, which lead to a performance benefit with high throughput
applications.
2018-09-30 21:54:08 +00:00
Jon Gjengset f785f88a58 Bump fontconfig dependencies
The patch uses the Cargo.toml patch section to force a single downstream
choice of freetype-sys instead of relying on forks of other crates. It
also bumps the fontconfig/freetype dependencies in the process.
2018-09-30 20:44:14 +00:00
Christian Duerr e01317d885
Fix failing test with `bench` feature
Using the `bench` feature, `cargo test` was failing since one of the
benchmarks was running into a debug assertion for attempting to access a
line with an index beyond the grid length.

Since this issue was caused by the `len` property not being serialized
and deserialized, the `#[serde(skip)]` attribute has been changed to
`#[serde(default)]`. The ref-test has been edited to include the correct
grid length for proper deserialization.

This fixes #1604.
2018-09-29 20:48:24 +00:00
Christian Duerr 1887722ef5
Fix rendering of selections outside the viewport
When rendering selections with both start and end outside of the visible
area, Alacritty would assume that both start and end are either above or
below the viewport and not render the selection at all.

To fix this the `buffer_line_to_visible` method now returns a
`ViewportPosition` instead of an `Option<Line>`, this allows giving more
feedback about where outside of the visible region the line is using the
`ViewportPosition::Above` and `ViewportPosition::Below` variants.

Using these newly introduced variants, a selection spanning the whole
screen is now rendered if the selection should go from above the visible
area to below it.

This fixes #1557.
2018-09-28 22:07:24 +00:00
Niclas Zeising 88076938ed Add note about package install on FreeBSD 2018-09-28 20:11:44 +00:00
Christian Duerr 93837110aa
Fix deserialization of old decorations values
The deprecated `window.decoration` values `true` and `false` were using
the `visit_bool` visitor for serde. However, only the `str` visitor was ever
called.

To print the correct deprecation notice, the bool visitor has been
removed and the warning has been added for the `"true"` and `"false"`
str visitor.
2018-09-28 19:53:57 +00:00
Christian Duerr 5e97fcbea4
Fix selection start point lagging behind cursor
Since the mouse start position has been the first movement event after
the mouse button was held down, there have been some issues with the
start point lagging behind the cursor because movement events were not
reported from the initial position but there was a gap until movement
starts reporting.

To fix this whenever the mouse button is pressed, the position and cell
side is stored on the `Mouse` struct. Because of this it does not matter
anymore if the movement events are all reported and we can just start a
selection using the stored position/side whenever there currently is no
selection present.

This fixes #1366
2018-09-27 12:12:49 +00:00
Christian Duerr 593d7718d0
Fix selection of empty lines
When selecting multiple lines in Alacritty, there was an issue with
empty lines not being copied. This behavior has been chanaged so empty
lines should be correctly copied now.

When copying content which ends with an empty line, Alacritty would copy
an additional empty line.

This has been resolved by only adding empty lines when the empty line
was not in the last selected line.
2018-09-26 18:42:41 +00:00
Niklas Claesson 94b9345a26 Implement CNL and CPL escape codes (#1590) 2018-09-26 10:38:41 -07:00
Christian Duerr 2ef376bb72
Fix reset cursor terminfo escape
The reset cursor terminal escape sequnce specified in the terminfo file
was using xterm's `\E[2 q`. However this just resets the cursor to the
block cursor shape.

Since Alacritty supports the `\E[0 q` escape sequence for resetting the
cursor shape to the original shape specified in the configuration file,
the terminfo file has been altered to make use of this sequence instead.
2018-09-25 01:04:33 +00:00
Daniel Eklöf ec3a80427b Add standalone terminfo definition
This replaces the current definitions, which depend on the system's
'xterm-256color' terminfo definition with the `alacritty` and
`alacritty-direct` definitions.

The new definitions are completely standalone.

The default `TERM` value has been changed to be dynamically
set based on the definitions installed on the system. Alacritty will
try to use the `alacritty` definition first and fall back to
`xterm-256color` if the `alacritty` definition is not present.
2018-09-24 19:06:12 +00:00
Christian Duerr 3d7e88e8a9
Dynamically initialize grid storage
Previously Alacritty has initialized all lines in the buffer as soon as
it is started. This had the effect that terminals which aren't making
use of the scrollback buffer yet, would still consume large amounts of
memory, potentially even freezing the system at startup.

To resolve this problem, the grid is now dynamically resized in chunks
of `1000` rows. The initial size is just the visible area itself, then
every time lines are written to the terminal emulator, the grid storage
is grown when required.

With the worst-case scenario of having 100_000 lines scrollback
configured, this change improves startup performance at the cost of
scrolling performance.

On my machine the startup changes from ~0.3 to ~0.2 seconds.

The scrolling performance with large throughput is not affected, however
it is slowed down when the number of lines scrolled are close to the
100_000 configured as scrollback. The most taxing benchmark I've found
for this was running `yes | dd count=500 > 500.txt` (note the relatively
small file size). This will cause a slowdown on the first run from 0.05s
to 0.15s. While this is significant, it lines up with the time saved at
startup.

This fixes #1236.
2018-09-24 18:40:09 +00:00
Gris Ge a752066bfa Allow copying selection to primary clipboard
A new configuration option `save_to_clipboard` has been added
to the `selection` section of the configuration. This allows writing
every selection to the primary system clipboard when it is set
to `true`.

On linux the selection is still written to the selection clipboard,
independent of the value of the `save_to_clipboard` setting.
2018-09-24 12:12:45 +00:00
Christian Duerr cd79680ba2
Implement config option for term colors 16..256
This adds a config option which allows setting terminal colors above the
0..16 range.

Live config reload already works for this, so it is possible to change
these colors the same way it works with the normal colors.

If a color below 16 is specified, the configuration will throw an error,
so the normal colors can't be overridden. This is just to prevent
possible complications with the settings that already exist.
2018-09-23 23:05:15 +00:00
trimental 9b694fcc54 Fix mesa rendering outside window borders on wayland
The mesa workaround has lead to some issues with
rendering on Wayland.

To resolve this problem, the mesa workaround has been
restructured in a way which still allows clearing the screen
before rendering without killing performance with the mesa
driver. The performance is identical to the master brach
and there have been no recorded regressions.
2018-09-23 16:21:47 +00:00
Christian Duerr cee35b309d
Unify configuration file structure
This changes a lot of small details in the configuration file in an
attempt to unify its structure. These are some main guidelines used for
this refactoring:
    - Specify that changes require restart consistently
    - Unify the specification of available field values
    - Provide clear distinction between description title and body

Besides these guidelines used to unify minor details in the
configuration file, the section on key configuration has been completely
reworked in an attempt to reduce the amount of text used. This should
make it possible to understand what's going on without having to read
any text.

The notice that modifiers are not supported has been removed from the
mouse binding documentation.
2018-09-22 02:46:41 +00:00
Christian Duerr 6cfd7aea82
Fix config error with missing decorations field
The latest change to window decorations
(3b46859ece) introduced a regression when
running Alacritty without the `decorations` field specified in the
configuration file. Since serde wasn't setup to fallback to the default,
the complete config deserialization would fail.

This resolves this issue by deserializing it to the default decorations
value "Full". To make this setting a little more forgiving, this also
introduces another change which ignores the case for the configuration
options. So both `full` and `FuLl` are now accepted.
2018-09-20 16:58:45 +00:00
Joe Wilm 34ba485fb5 Fix CHANGELOG.md
The bracketed paste mode change isn't so much a fix as it is a change to
address a potential security issue.
2018-09-20 08:25:28 -07:00
Joe Moon 3b46859ece Improve window.decorations options: (#1241)
The decorations config was changed from a bool to an enum.
`full` has taken the place of `true`, and `none`, has replaced `false`.

On macOS, there are now options for `transparent` and `buttonless`.
These options are explained in both the CHANGELOG and in the
configuration files.
2018-09-20 08:24:26 -07:00
Joe Wilm 641f3291eb Update CHANGELOG for #1243 2018-09-20 07:59:52 -07:00
Aidan Epstein 417ad9d430 Fix Bracketed Paste Mode when input contains end sequence. (#1243)
* Fix Bracketed Paste Mode when input contains end sequence.
* Remove \x1b instead of just the paste end sequence.
2018-09-20 07:58:57 -07:00
Joe Wilm 177a5c39c3
Merge pull request #1573 from ChrisMacNaughton/patch-1
Update snapcraft.yaml
2018-09-20 07:16:26 -07:00
Chris MacNaughton 6e9859395c
Update snapcraft.yaml
The existing snapcraft.yaml is pointing to a file that has been renamed,
subsequently breaking the snap build. This change renames the .desktop
file to match what is in-tree.
2018-09-20 08:39:53 +02:00
Christian Duerr ef06109d94
Add changelog entry for 32-bit fix 2018-09-20 02:05:30 +02:00
Johannes a769e80eb4 Fix build failure on 32-bit machines
Alacritty has some checks in place to make sure that unsafe
code would not fail because of invalid struct sizes. This managed
to successfully catch an incorrect unsafe block on 32-bit machines.

To make sure this block works on both 32-bit and 64-bit systems,
it has been altered to make use of the platform-dependent `usize`
type. This will always make use of correct sizes without having to
rely on conditional compilation.
2018-09-20 00:04:07 +00:00
Jeff Muizelaar 26c4043aaf Update core-* dependencies
The core-* dependencies have been updated and every breaking
change has been resolved.

These are the main changes which required adaption:
- font_path() returns a PathBuf now
- get_descriptors() returns an Option<CFArray>
- get_advances_for_glyphs and get_glyphs_for_characters are now unsafe.

All packages which did not have breaking updates have also been updated.
2018-09-19 21:55:35 +00:00
Christian Duerr bd6e5a99be
Show hollow cursor for windows starting unfocused
Alacritty made the assumption that every window started as focused and
because of that the hollow cursor wouldn't show up for windows which are
launched without focus.

Since even the initial focus should be reported as a focus event by
winit, this could be easily fixed just setting the default window state
to unfocused instead of focused.

This fixes #1563.
2018-09-19 21:37:37 +00:00
Christian Duerr d387ebe1d7
Add hidden escape sequence
This adds support for the `hidden` escape sequence `\e[8m`, which will
render the text as invisible.

This has also raised a few questions about the rendering of foreground
and background colors and their interaction with the different escape
sequences. Previously, Alacritty has oriented itself after URxvt, which
has some strange and unexpected behavior.

The new implementation of color inversion is modeled after XTerm, which
has a consistent pattern of always inverting the foreground and
background colors. This should hopefully lead to less confusion for the
user and a more consistent behavior.

A full matrix showcasing the new way Alacritty inverses text can be
found here:
https://i.imgur.com/d1XavG7.png

This fixes #1454 and fixes #1455.
2018-09-19 19:18:51 +00:00
Philipp f0ce64e24b Opt-in to macOS Mojave Dark Mode
macOS 10.14 will bring a new system wide dark mode. To enable this, the
[official guides][] suggest to relink using the newest OS. This
approach, however, did not work for me as described in [an issue][] in
the glutin repository.

As a second option, the accompanying `Info.plist` file can also
overwrite the link-time check and enable dark mode rendering if the
system config is set by setting `NSRequiresAquaSystemAppearance` to
`YES`. This approach seems to work flawlessly no matter if a user opts
into dark mode or not.

I would appreciate it if someone can test this on macOS 10.13 as well,
but I suppose the key there is unused and would not break anything.

[official guides]: https://developer.apple.com/documentation/appkit/appkit_release_notes_for_macos_10.14_beta
[an issue]: https://github.com/tomaka/glutin/issues/1053#issuecomment-409315461
2018-09-18 20:27:40 +00:00
Daniel Eklöf 05d40a8adc Mention required terminfo update when changing tabspaces
Changing tabspaces from the default (8) requires a corresponding
update to the `it` item in the terminfo entry used.

Some applications, like Emacs, rely on knowing the width of a tab, and
will experience unexpected behavior if the terminfo data does not
match the actual width used.
2018-09-18 20:20:59 +00:00
Christian Duerr 00bd098765
Set upper limit for scrollback history size
Since the scrollback history allocates all lines in memory, it is
possible to specify a scrollback history which is big enough to freeze
the computer due to OOM.

To resolve this issue, an upper limit of `100_000` has been set for the
scrollback history. Even though this might still cause some systems to
freeze, this should provide a good balance for most users.
2018-09-18 15:54:40 +00:00
Matthias Krüger 63a40df520 Fix style issues 2018-09-17 23:34:56 +00:00
VoidNoire 55e675a3d8 Add `fontconfig-devel` dependency for building on Void Linux 2018-09-17 22:01:54 +00:00
Nathan West a10403b7c7 Fix fish completion name in deb installer 2018-09-17 21:44:29 +00:00
Alexander Schlarb e2c1e56b25 Give zsh completion file the correct name when installing with `cargo deb --install`
The zsh completion name for the deb installer has been corrected.

The installation instructions for the zsh completions have also been
updated to make it possible to install them without root permissios.
2018-09-17 21:37:00 +00:00
David Peter 35ea0cded2 Set COLORTERM variable to advertise 24-bit support
Set `COLORTERM` to `truecolor` in order for applications to be able to
detect that alacritty supports 24-bit colors.

See https://gist.github.com/XVilka/8346728 for more details.

Closes #1526.
2018-09-17 20:32:08 +00:00
nolanl 7a8a002da6 Acknowledge first click on unfocused windows with bsd/linux
Fixes a regression on non-macOS platforms caused by the fix for
issue #1291. The fix is to follow platform norms for mouse click
behavior on unfocused terminals. On macOS, the first click (that
gives the window focus) is swallowed, and has no effect on the
terminal. On all other platforms, the first click is passed through
to the terminal.
2018-09-17 20:00:42 +00:00
Christian Rebischke 1f243468dc Add mention of official arch linux package
Since Alacritty does not require the AUR anymore, its mention has been
removed from the README.

To make future changes simpler, the README has also been reworded so
less changes are required for adding new operating systems.
2018-09-17 19:09:39 +00:00
Joe Wilm 8b71eede52 Add latest blog post to README 2018-09-17 08:56:15 -07:00
Joe Wilm cff58e9d68
Merge pull request #1147 from jwilm/scrollback
Scrollback
2018-09-17 08:15:20 -07:00
Joe Wilm 054e38e98d Bump version in CHANGELOG 2018-09-17 07:56:58 -07:00
Christian Duerr ca1b75b4c0 Bump version number to 0.2.0 (#1492)
* Change deb installation from crates.io to git

There have been a number of issues an PRs opened since
the cargo-deb installation does not work with the latest
version from crates.io.

To help out users until the crates.io version is updated,
the installation instructions have been temporarily
changed to install `cargo-deb` through github.

* Revert cargo-deb install back to use crates.io

Since `cargo-deb` has been updated on crates.io it is now
possible to just install it from crates.io and build Alacritty's
deb without having to rely on github.

* Update dependencies

This fixes an `illegal hardware instruction (core dumped)`
error when building in release mode.

* Remove redundant copy when selecting font_key

* Bump version number to 0.2.0

Since the Scrollback branch introduces some major changes, this bumps
the version number from 0.1.0 to 0.2.0.

The versions of Alacritty have not been updated regularly to this point,
so the scrollback branch is a good point in time to start updating
Alacritty's version on a regular basis.

Further changes to the readme, like dropping the 'alpha' status and
updating it to 'beta' could also be introduced with this branch. This
way there will be a clean cut which updates everything as soon as
scrollback is merged.

Building versions is another thing which would be a good thing to start
reasonably quickly. However starting this on the main branch after
scrollback has been merged seems like a more reliable way to move
forward.

This fixes #1240.

* Add a CHANGELOG file

A CHANGELOG file has been added to offer a bit more transparency over
which features have been changed, added and potentially removed in
Alacritty.

There are various formats available for the CHANGELOG file but the most
common and sensible one seems to be the one defined by
https://keepachangelog.com/en/1.0.0. Following the template proposed by
this it should be possible to create a clear CHANGELOG which makes it
simple for new contributors to figure out exactly which formatting
should be used for it.

Since there have been quite a few changes to Alacritty already, not all
changes have been added to the changelog. However a few entries have
been ported just to give a bit of an example what the format should look
like. This also helps with the 0.2.0 version since it will not be
completely empty in the changelog.

This fixes #1534.

* Update CHANGELOG

This updates the CHANGELOG to include the changes introduced by
43882ade33.
2018-09-17 07:54:47 -07:00