Commit Graph

984 Commits

Author SHA1 Message Date
Matt Keeler 2434547fce Upgrade Glutin to v0.19.0
Some changes include:

• Use the with_hardware_acceleration function on the ContextBuilder to not require the discrete GPU
• Remove the LMenu and RMenu virtual key codes (winit 0.16.0 removed these because Windows now generates LAlt and RAlt instead
• Replace set_cursor_state with hide_cursor (winit 0.16.0 removed the set_cursor_state function)
• Replace GlWindow::hidpi_factor with GlWindow::get_hidpi_factor and change to expecting an f64
• Use the glutin/winit dpi size and position types where possible

Glutin's dpi change event has been implemented. All size events now
return logical sizes. As a result of that, the logical sizes are translated
in the `display::handle_rezize` method so DPI scaling works correctly.

When the DPI is changed, the glyph cache is updated to make use of the
correct font size again.

Moving a window to a different screen which is a different DPI caused a
racing condition where the logical size of the event was sent to the
`handle_resize` method in `src/display.rs`, however if there was a DPI
change event before `handle_resize` is able to process this message, it
would incorrectly use the new DPI to scale the resize event.

To solve this issue instead of sending the logical size to the
`handle_resize` method and then converting it to a physical size in
there, the `LogicalSize` of the resize event is transformed into a
`PhysicalSize` as soon as it's received. This fixes potential racing
conditions since all events are processed in order.

The padding has been changed so it's also scaled by DPR.

The `scale_with_dpi` config option has been removed. If it's not present
a warning will be emitted.

The `winit` dependency on Windows has been removed. All interactions
with winit in Alacritty are handled through glutin.
2018-11-10 16:08:48 +00:00
Alex Touchet 81617983bb Fix grammatical errors in README 2018-11-07 20:04:41 +00:00
Alex Touchet 36f376fea8 Capitalization changes in README.md (#1757) 2018-11-07 09:49:13 -08:00
Christian Duerr 06fbb891cf
Add automated i386 docker builds to travis 2018-11-06 00:40:29 +00:00
Christian Duerr 0e49bfb02a
Update readme to link to the github releases 2018-11-04 00:13:18 +00:00
Christian Duerr 0b1754e73f
Fix clippy issues
This resolves all existing clippy issues and removes some old `allow`
annotations which aren't neccesary anymore.
2018-11-04 00:11:51 +00:00
Christian Duerr d2f4972703
Fix windows tagged builds
The windows tagged builds currently fail some tests since the
winpty-agent.exe is inside the release directory instead of the debug
directory with tagged builds.
2018-11-03 18:46:26 +00:00
Micha Gorelick 77816797e8 Publish Github releases from Travis
This release introduces some config to automatically build deploy a
binaries on the github release page using travis. The build only happens
when a commit is tagged and it uses the stable version of rust.

The main travis sections (install/script/before_deploy) have been
moved out of the .travis.yml to make it easier to read, maintain and
extend the different steps of the CI process.

Since checking for the Rust version in CI is enough to know if clippy
should be used or not, the environment variable `CLIPPY` has also been
removed, which further allowed simplifying the CI process.

Besides the executables, some auxillary files are now also published as
part of a release when they have changed since the last tagged Alacritty
release. This should make it clear for returning users when a new
version of a specific auxillary file is required.

Instead of using the 14.04 image which travis provides by default, an
18.04 docker image is used to build the output binaries for Linux.
This affects both the .deb and the .tar.gz binary.

The advantage of this is that while binaries compiled on 14.04, do not
work on 18.04, it does work the other way around. The generated .tar.gz
binary has been tested on 18.04, Debian, Fedora and Archlinux and all
systems were able to run it without any warnings or errors.
2018-11-03 15:08:30 +00:00
Nathan Lilienthal fd8af0df33 Fix selection while scrolling
Properly update an active selection while scrolling the main scrollback buffer.

This does not affect the alternate screen buffer, since no scrollback buffer is
available.
2018-11-02 01:34:02 +00:00
Christian Duerr a3f729f589
Fix default hollow cursor behavior with empty conf
The 2c37da48b5 change introduced some
changes to the way cursor configuration is handled. However it did not
properly handle the default behavior of the hollow cursor when the
`cursor` field was not specified at all.

By implementing the `Default` trait for the `Cursor` struct in
`config.rs` manually, the default value of the `unfocused_hollow` field
has been corrected back to `true` when the `cursor` struct isn't present
at all.
2018-11-01 20:50:32 +00:00
Niclas Zeising a846faa6ef Add Instructions for installing on FreeBSD
Readd instructions for how to install pre-compiled alacritty packages on
FreeBSD.  This was accidentaly removed in cb6e065.
2018-11-01 20:09:19 +00:00
Christian Duerr 2c37da48b5
Fix mouse pasting in mouse mode with shift
It is now possible to paste in mouse mode again by making use of the
`shift` key while pressing the mouse button reserved for PasteSelection.

All mouse bindings are now also matching the modifiers in a relaxed way,
so extra modifiers are ignored.
2018-11-01 19:35:37 +00:00
Christian Duerr a7d9554038
Rework cursor configuration
There are a couple of cursor-related options in the Alacritty config
file now, however they aren't grouped together in any way.

To resolve this a new `cursor` field has been added where all cursor
configuration options (besides colors) have been moved.

The `custom_cursor_colors` option has also been removed, since it's not
necessary anymore. Simply making the `colors.cursor.*` fields optional,
allows overriding the cursor colors whenever one of them is present.
Like that the user doesn't have to think about a relation between two
separate configuration options.

This PR initially put the `hide_cursor_when_typing` variable under
`cursor.hide_when_typing`. However this field is completely unrelated to
the cursor, but instead relates to the mouse cursor.

Since the word `cursor` is already used for the active cell in the grid
of a terminal emulator, all occurences of the word `cursor` when talking
about the mouse have been replaced with the word `mouse`.

The configuration option has also been moved to
`mouse.hide_when_typing`, to make it clear what this option is changing.

This fixes #1080.
2018-11-01 17:23:49 +00:00
Do Duy f0579345ea Update serde_yaml to 0.8
This fixes jwilm/alacritty#1730.
2018-11-01 11:45:20 +00:00
Christian Duerr 8b8d9ea7f8
Add change log entry for configuration fix
This updates the CHANGELOG.md to include information
about the changes which have been made in #1634.
2018-10-31 22:19:59 +00:00
Dominic Evans fd6a5512b6 Sync .app bundle timestamp during build
Fixes #1717.
2018-10-31 19:48:04 +00:00
Christian Duerr 5a8a34304f
Fix deb build
Since cargo-deb builds all members of the workspace by default, it is
necessary that the winpty subcrate can be built on all operating
systems, since it's not possible to have OS-specific workspace members.

To achieve this the crate has been changed to be empty by default on
non-windows systems. It might make sense to do something similar with
winpty-sys, but it's not strictly necessary at this point since we don't
directly depend on it.

This fixes #1716.
2018-10-31 19:47:21 +00:00
Christian Duerr cc1ad49172
Update Windows configuration file
The Windows configuration file was outdated compared to the other
configuration files, since there were some major changes to the config
during the development of the Windows PR.

All changes between the Linux and Windows configuration file have been
removed, preserving platform-specific configuration defaults that were
intentionally changed.

Some minor changes have also been made to the Linux and macOS
configuration files, since there were some inconsistencies left.

This fixes #1692.
2018-10-30 19:04:03 +00:00
Zac Pullar-Strecker 6c7308099f Revert "Update Windows configuration file"
This reverts commit a9e03f1ae0.
2018-10-30 17:05:24 +13:00
Christian Duerr a9e03f1ae0
Update Windows configuration file
The Windows configuration file was outdated compared to the other
configuration files, since there were some major changes to the config
during the development of the Windows PR.

All changes between the Linux and Windows configuration file have been
removed, preserving platform-specific configuration defaults that were
intentionally changed.

Some minor changes have also been made to the Linux and macOS
configuration files, since there were some inconsistencies left.

This fixes #1692.
2018-10-29 19:47:41 +00:00
Zac Pullar-Strecker 58127f4687 Add cargo workspace, add winpty tests to CI 2018-10-29 20:52:14 +13:00
Zac Pullar-Strecker df82b5ffbd Explicitly detach from the console on exit
Without this cmd won't redraw it's prompt when alacritty exits
2018-10-28 10:53:01 +13:00
Christian Duerr a54cc4ec60
Refactor platform-specific code 2018-10-27 18:54:28 +00:00
Christian Duerr a9397727d2
Relax matching of URL modifiers
To click on links in the alternate screen buffer, it is necessary that
the `shift` button is held down, otherwise mouse events are captured by
the application. However this would also require that `Shift` is added
to the `mouse.url.modifiers` option. Thus it is not possible anymore to
click on URLs unless the shift button is always held down.

To resolve this issue, the matching of modifiers has been relaxed. If a
modifier is specified in the config, it is always required to be held
down. However if a modifier is held down which is not specified, it is
still accpeted. This one-way relaxed matching allows clicking on links
with or without shift held down without having to make use of the
`mouse.url.modifiers` setting at all.
2018-10-27 14:15:08 +00:00
Georgy Yakovlev e5ca26518e Add official Gentoo package to install instructions 2018-10-27 11:14:13 +00:00
Zac Pullar-Strecker 8f2a4b89df Move gentoo install instructions, add windows to table of contents 2018-10-27 15:58:51 +13:00
Christian Duerr 04127ed31f
Fix change log entry for URL clicking 2018-10-22 21:41:34 +02:00
Christian Duerr 8ee0d2b5b2
Add option to open URLs on click
This adds the option to automatically launch URLs with a specified
program when clicking on them.

The config option `mouse.url_launcher` has been added to specify which
program should be used to open the URL. The URL is always passed as the
last parameter to the specified command.

It is not always desired for URLs to open automatically when clicking on
them. To resolve this a new `modifiers` field has been introduced to the
config, which allows specifying which keyboard modifiers need to be held
down to launch URLs in the specified launcher.

Some tests have been added to make sure that the edge-cases of the URL
parsing are protected against future regressions. To make testing easier
the parsing method has been moved into the `SemanticSearch` trait. The
name of the trait has also been changed to just `Search` and it has been
moved to `src/term/mod.rs` to fit the additional functionality.

This fixes #113.
2018-10-22 19:39:26 +00:00
Christian Duerr 4380d0864b
Fix rotation of selection below 0
Whenever the viewport is scrolled, the selection is rotated to make sure
that it moves with the viewport. However this did not correctly handle
the underflow that happens when the selection goes below 0.

This resolves that problem for the selection by moving the internal line
representation to an isize, thus correctly keeping track of the
selection start/end points even when they have a negative index. Once
the selection is converted to a span, the lines are clamped to the
visible region.

This fixes #1640 and fixes #1643.
2018-10-20 22:30:59 +00:00
Zac Pullar-Strecker 34ada9295d Add support for rendering cursors to rusttype 2018-10-20 20:16:26 +00:00
Zac Pullar-Strecker a7e59d393d Attach to the console of the parent process on windows
This fixes not seeing console output on windows release builds.
2018-10-18 17:01:50 +13:00
OJ Kwon f3a76e24f1 build(package): acquire latest winpty 2018-10-17 18:38:33 +13:00
Christian Duerr 9bc888fbe5
Fix appveyor badge link 2018-10-16 19:16:12 +00:00
Christian Duerr a727801f60
Allow the usage of scancodes in the config
This change should allow the usage of scancodes in the configuration
file.

When a VirtualKeyCode for glutin is not present, this should now allow
the user to use the scancodes instead. If the user specifiecs a key with
its scancode even though the key has a VirtualKeyCode, it should still
work.

The behavior of directly specifying a VirtualKeyCode should be unchanged
by this.

This fixes #1265.
2018-10-16 18:46:26 +00:00
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