Commit graph

123 commits

Author SHA1 Message Date
Christian Duerr fc28e49c27
Add change log entry for Wayland title fix
Fixes #2104.
2019-03-15 20:48:51 +00:00
Aaron Goodfellow e2eb5bbd2e Add additional key bindings for changing font size
This fixes #2010.
2019-03-15 20:41:48 +00:00
Christian Duerr 0f96a62218
Update glutin to version 0.20
Fixes #458.
Fixes #1681.
2019-03-14 20:06:38 +00:00
Christian Duerr b1032bcc6b
Add text reflow
Alacritty will now automatically reflow lines and shrink them when they
would usually exceed the new width of the terminal instead of
truncation.

If a line had to be truncated, it will also be reflown into the previous
line after growing the terminal width.

The reflow behavior when not at the bottom of the history is similar to
that of VTE and aims to keep the viewport stationary whenever possible.

Opposed to VTE, reflow will also be performed in the alternate screen
buffer.

There will be bugs when resizing the terminal emulator to a size smaller
than the prompt, though these issues were present in all terminal
emulators with reflow support.

This fixes #591.
2019-03-13 18:55:18 +00:00
Kirill Chibisov 0b9ae4ce93 Add config option to change selection color 2019-03-12 23:11:32 +00:00
Rachel K 62c1d999e1 Fix signal handling on Unix systems
This removes the the signal handling machinery in tty::unix, and
replaces it with functionality from signal-hook, which should be more
robust. Signals caught by signal-hook wake up the existing I/O event
loop, which then delegates back to the PTY to handle them.

In particular, this allows `SIGCHLD` (i.e. child process exits) to shut
down the terminal promptly, instead of sometimes leaving the window
lingering.

Fixes #915.
Fixes #1276.
Fixes #1313.

As a side effect, this fixes a very rare bug on Linux, where a `read`
from the PTY on the master side would sometimes "fail" with `EIO` if the
child closed the client side at a particular moment. This was subject to
a race condition, and was very difficult to trigger in practice.
2019-03-12 19:44:47 +00:00
Cole Helbling e240da9ab3 Add option for window position at startup 2019-03-11 12:35:49 +00:00
Tobias Kortkamp 0ec4bd28da Add support for SpawnNewInstance using linux compat on FreeBSD
This fixes opening a new instance in the shell's current working
directory.  The code currently assumes that there is a Linux
compatible procfs mounted on /proc which is not the case on FreeBSD.
However linprocfs(5) is often mounted on /compat/linux/proc so we
can use that here for the time being.

A proper solution would look up the kern.proc.cwd.<pid> sysctl
instead, but that is not currently easily doable due to missing
KERN_PROC_CWD and struct kinfo_file definitions in the libc crate.
2019-03-08 16:36:23 +00:00
David Hewitt ea87c1546b Add dynamic title support for Window 2019-03-07 20:37:11 +00:00
David Hewitt 9ba7c4fae4 Make start_daemon behaviour on Windows consistent with Unix
In cases where the Alacritty process had invalid std handles then
the ConPTY subprocess would fail to spawn. By setting appropriate
flags we prevent these handles from being passed to the ConPTY
subprocess.
2019-03-04 22:58:03 +00:00
Lado Tonia 104b866cb6 Fix selection starting inside padding
This fixes #2109.
2019-03-04 16:20:15 +00:00
Christian Duerr 1ca729487e
Fix terminfo support for extended capabilities
To make sure all extended capabilities can be queried correctly, it is
necessary to compile the terminfo file using the `-x` flag.

Since Alacritty specified support for the XTerm mouse mode (XM/xm),
using the `-x` flag was not possible until now without breaking programs
like `htop`. By removing this flag, these issues should be resolved.

This fixes https://github.com/jwilm/alacritty/issues/2131.
2019-03-03 20:25:29 +00:00
Christian Duerr de52ddb6c2
Fix alt screen bugs
This fixes two bugs with the alternate screen buffer.

When resetting while in the alt screen, Alacritty would not swap out
the grids leading to scrollback getting disabled. By swapping out the
grids again when resetting in the alternate screen buffer, scrollback is
now unaffected from a reset.

There was another issue with the cursor jumping around when leaving the
alt screen even though it was not active, this was fixed by skipping all
alt screen swap routines unless the current state matches the expected
state.

This fixes #2145.
2019-03-02 21:30:29 +00:00
stfn 9468b50b75 Add additional key bindings 2019-03-02 18:57:07 +00:00
Christian Duerr 3c4bb7c115
Fix scrollback live reloading
This fixes two issues with live reloading the `scrolling.history`
property.

It is now possible to increase the scrollback history without restarting
Alacritty.

When decreasing the scrollback history while scrolled beyond the new
history limit, Alacritty will reset the viewport position to the new
limit instead of crashing.

This fixes #2147.
2019-03-02 18:32:48 +00:00
Erik Berkun-Drevnig e0fdc3329c Add MSI installer for Windows 2019-03-02 18:31:14 +00:00
Christian Duerr 3c672cca4b
Fix selection copying with mouse outside of window
There was an issue caused by 35efb4619c
which would lead to the current selection not getting copied to the
clipboard if the mouse was released outside of the window.

Instead of aborting any press/release actions when the cursor is not
inside of Alacritty, the handling is now delayed until actual usage.
2019-02-21 21:13:14 +01:00
David Hewitt 14e3a0ae5a Fix panic on exit with ConPTY
Even though the `ClosePseudoConsole` API does not have a return
value, it was incorrectly queried by the `Drop` implementation for
the ConPTY, leading to a panic on exit.

The definition of this call has been updated to match the actual
function signatures, which resolve this problem.
2019-02-21 09:28:33 +00:00
Christian Duerr 3ec53b4f0b
Bump version to 0.2.9 2019-02-11 23:59:21 +00:00
Christian Duerr bfb67ed8f2
Fix font spacing error
Fixes #2098.
2019-02-11 21:33:37 +00:00
Christian Duerr 85df82a6fd
Bump version to 0.2.8 2019-02-10 20:14:52 +00:00
Christian Duerr 83d7f60449
Fix dimensions CLI/manpage docs 2019-02-10 18:42:57 +00:00
Martin Sucha b55e219bc4 Change font size only when new metrics are valid
This prevents cell_width or cell_height being zero.

Fixes #1693
2019-02-09 19:04:06 +00:00
Christian Duerr ecd9270ffe
Remove selections when clearing screen partially
Automatically remove all selections when part of the screen is cleared.
This fixes issues in applications like `less -S` where a selection would
stay around after scrolling horizontally.

XTerm and URxvt both choose to always remove the selection, even if it's
outside of the cleared area, however VTE only clears the selection if
any part of it is inside the cleared area.

To keep things simple, Alacritty has adopted the behavior of XTerm and
URxvt to always clear selections.

This fixes #1644.
2019-02-08 04:49:44 +00:00
Christian Duerr 153f9257b8
Change shift+pgup/pgdown to scroll history
The default shift+pgup/pgdown buttons were sending the escape sequences
specified by the official standard, however most terminal emulators like
XTerm, URxvt and VTE make an exception for this special case and instead
scroll the native history buffer.

Both XTerm and URxvt do never send the escapes for Shift+PgUp/PgDown,
however VTE does send them in the alternate screen.

Since Alacritty already supports keybindings based on terminal mode and
the binding to scroll the history is useless when in the alternate
screen buffer, Alacritty is now following VTEs behavior here, allowing
applications in the alt screen (like vim) to handle this escape.

Fixes #1989.
2019-02-08 01:46:56 +00:00
Christian Duerr 35efb4619c
Dynamically resize terminal for errors/warnings
The warning and error messages now don't overwrite other terminal
content anymore but instead resize the terminal to make sure that text
can always be read.

Instead of just showing that there is a new error and pointing to the log,
errors will now be displayed fully in multiple lines of text, assuming that
there is enough space left in the terminal.

Explicit mouse click handling has also been added to the message bar,
which made it possible to add a simple `close` button in the form of
`[X]`.

Alacritty's log file location is now stored in the `$ALACRITTY_LOG`
environment variable which the shell inherits automatically.

Previously there were some issues with the log file only being deleted
when certain methods for closing Alacritty were used (like typing
`exit`). This has been reworked and now Ctrl+D, exit and signals should
all work properly.

Before the config is reloaded, all current messages are now dropped.
This should help with multiple terminals all getting clogged up at the
same time when the config is broken.

When one message is removed, all other duplicate messages are
automatically removed too.
2019-02-07 22:36:45 +00:00
Christian Duerr e561ae3733
Fix unclickable URLs with scrolled viewport
Since scrolling the terminal moves around the underlying data structure
of the terminal, the URL selection would search for the URL at the
position where the click would have been without any scrolling.

By adding the viewport offset to the click position, the URL clicking
now searches at the correct location.

This fixes https://github.com/jwilm/alacritty/issues/2076.
2019-02-07 00:55:18 +00:00
Christian Duerr a7a6bf53d4
Set window title on Wayland
Fixes #1582.
Fixes #1875.
2019-02-06 21:10:45 +00:00
Desuwa 879ea05b66 Scale IME position by hidpi_factor
Since the IME was positioned using physical coordinates,
the location would be incorrect with monitors using a DPR
other than 1.0.

This has been resolved by converting the physical position
to a logical position using the methods built into winit.

Fixes #2056.
2019-02-05 22:33:07 +00:00
Christian Duerr 97e801a73e
Fix macOS config decorations doc 2019-02-04 00:17:57 +00:00
Christian Duerr 20f3198609
Fix regression in the URL launcher config
Due to the merging of configuration files on all platforms, it has been
made impossible to completely disable URL launching without still
executing some kind of program like `true`.

Setting the launcher to `None` in the config, will now disable it
completely.

This fixes #2058.
2019-02-03 16:44:39 +00:00
Christian Duerr 53e491709d
Fix reloading with empty config
When loading an empty configuration file, Alacritty only prints an info
message and then proceeds to load the default config. However when
reloading the configuration file it would throw a hard error.

This has been fixed and a hard error is now only thrown when an error is
returned during reload which isn't the empty file error.
2019-02-02 12:03:03 +00:00
Sander van Harmelen 3562f2c9aa Trim unicode characters from the start of URLs 2019-01-28 18:28:51 +00:00
ray851107 fe8577ccfb Improve touchpad scrolling
By scaling fractional scaling by scrolling multiplier
before conversion to lines it is now possible to scroll
much more accurately with touchpads.

The `scrolling.multiplier` now also applies to touchpads.
2019-01-27 21:06:27 +00:00
Christian Duerr 5e0d740943
Update dependencies
This resolves an issue with notify that caused excessive wake-ups when
waiting for config updates.

Fixes #2029.
2019-01-23 22:05:47 +00:00
Alexander Bulimov c3bac1c453 Fix off-by-one error in erase_chars 2019-01-21 21:59:10 +00:00
Christian Duerr d62fe71b60
Bump version to 0.2.7 2019-01-21 16:39:24 +00:00
Christian Duerr 31271c726e
Fix crash on Windows (#2021)
The rusttype backend did not properly support manually specifying font
styles, but instead chose to panic when they are specified.

The rusttype implementation now provides a proper implementation for
handling `bold`, `italic` and `regular` font styles.

This fixes #2020.
2019-01-20 17:39:15 +00:00
Christian Duerr 693edaab3f
Bump version to 0.2.6 2019-01-19 16:00:09 +00:00
Carlos Tuñón 09003f6c30 Fix crash on macOS and BSD with SpawnNewInstance action 2019-01-19 13:45:45 +00:00
Simon Dahlberg 8b15596070 Add config option to send or not send ESC when ALT-key is pressed 2019-01-17 20:42:12 +00:00
Christian Duerr 0d16478f5d
Make all configuration fields optional
All configuration fields now have fallback values which will be used if
the field is not present. This includes mouse, key bindings and platform
specific differences.

The mouse and key bindings are now filled by default, if the user
rebinds a default mapping, it will be overwritten. To unbind a default
binding, it can be mapped to `chars: ""`.

Since all platform differences can now be correctly handled by the
`src/config/mod.rs` code, it's no longer necessary to maintain separate
configuration files, so the `alacritty_macos.yml` and
`alacritty_windows.yml` have been deleted.

Fixes #40.
Fixes #1923.
2019-01-17 09:17:26 +00:00
Christian Duerr 5864c30a54
Fix tabs overwriting cells during movement
When compiling ncurses with the `--enable-hard-tabs` option, it will
make use of tabs to speed up cursor movement. These tabs can be set at
positions which will overwrite existing characters.

Since these are only for movement and not supposed to write anything to
the terminal, it is now checked that a cell does not contain any
character before writing a tab to it.

This fixes #1933.
2019-01-13 21:54:36 +00:00
Christian Duerr 5d3cbe51bc
Fix CPU load when moving windows between monitors 2019-01-09 22:51:04 +00:00
Christian Duerr 8570ee004b
Fix crash when starting Alacritty on full drives
Since the Alacritty configuration file is written to the filesystem at
startup, this could create issues when the system does not have any free
space left.

To circumvent this problem, the default configuration is now returned
even when the configuration file could not be created. Instead of
crashing Alacritty, an error is now emitted.

Fixes #1936.
2019-01-09 20:27:13 +00:00
Christian Duerr c541155167
Fix selection with right and middle mouse
Since there was no check for the button state for semantic and line
selection, it was possible to trigger selection using the middle and
right mouse button. This has been resolved by explicitly checking for
the pressed button before starting these selections.

To further ensure that double and triple clicks are only triggered when
the same button is pressed multiple times, the last pressed button is
stored.

This fixes #1915.
2019-01-08 07:37:58 +00:00
Christian Duerr a38a067992
Fix minor issues in the config documentation 2019-01-07 21:56:55 +00:00
Christian Duerr 55c894b30b
Bump version to 0.2.5
This bumps the version number to 0.2.5 and prepares everything for the
next versioned release.
2019-01-07 17:36:16 +00:00
Nathan Lilienthal 04707cbba6 Normalize Log Message Strings
The general style for errors, warnings and info messages is to start
with a capitalized letter and end without a period. The main exception
is when dealing with nouns that are clearer with special case handling,
e.g. "macOS failed to work" or "ioctl is borked".
2019-01-07 00:06:57 +00:00
Christian Duerr dfc30eeef5
Set minimum macOS version to 10.11
To make sure that CI builds produced by Travis work on all supported
versions of macOS and building Alacritty works on all supported
versions, the minimum macOS version has been set in the Makefile.

This sets the minimum macOS version to `10.11` as a reasonable
estimation based on other applications. If the exact version chosen
turns out to cause some issues, it can be changed in the future.
2019-01-06 19:12:30 +00:00