Commit graph

74 commits

Author SHA1 Message Date
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
Christian Duerr 873771fa59 Improve URL detection with special characters
Various special characters and character combinations were not handled
correctly with URL detection. All these instances have been resolved and
covered by various tests to prevent future regressions.

Notable fixes include single quotes working more properly now (like
`'https://example.org'`) and IPv6 URL support.

Since URL detection is now more than just a few lines of code and it's
mostly unrelated to the `Term`, it has also been extracted into the
`src/url.rs` file together with all URL-related tests.
2019-01-05 20:49:39 +00:00
Christian Duerr b6a5ba21a1 Limit number of URL schemes
This limits the number of allowed schemes for the URL launcher, to
reduce the number of false-positives.

The accepted URL schemes are now:
    - http
    - https
    - mailto
    - news
    - file
    - git
    - ssh
    - ftp

This fixes #1727.
2019-01-05 20:49:39 +00:00
Christian Duerr fbefd804c8 Fix removal of trailing URL characters
Some characters were not correctly stripped from the end of URLs with
the URL launching feature. The list of URL separator characters has been
extended to include '<', '>', '"', ' ', '{', '}', '|', '\\', '^' and
'`', following the URL specification defined here:

https://tools.ietf.org/html/rfc3987#page-13

Additionally, a list of characters which are always stripped from the
end of URLs has been setup to contain '.', ',', ';', ':', '?', '!', and
'/'.

This fixes #1753.
2019-01-05 20:49:39 +00:00
Christian Duerr dd8639b6cc Launch URLs only when left-clicking
This fixes #1903.
2019-01-05 20:49:39 +00:00
Carlos Tuñón e4dc43e87c Add key/mouse action for spawning new Alacritty instances 2019-01-05 20:47:12 +00:00
Nathan Lilienthal 2d9afb9b39 Process Mouse Binding Actions Earlier
To allow for a mouse binding to properly copy text, we should process
the mouse binding actions before thee built-in functionality, which will
clear the selection on right click, for example.
2019-01-02 21:56:36 +00:00
Jason Shirk 2e968ae0ad Change default Windows shell to PowerShell
Update the Windows shell settings and comments so they look familiar to
Windows users, but comment out the shell settings for consistency with
Linux and Mac.

Stop checking COMSPEC when the configuration file does not specify which
shell to use, and just default to PowerShell.
2019-01-02 21:40:32 +00:00
DarkDefender 9133f4d327 Use default cursor instead of arrow in mouse mode 2019-01-02 13:04:54 +00:00
David Hewitt f1bc6802e1 Add support for Windows ConPTY API 2018-12-28 16:01:58 +00:00
Christian Duerr ec6f756946
Fix Windows config location documontation
The path `%APPDATA%` already includes the `Roaming` folder.
2018-12-28 15:26:58 +00:00
Zac Pullar-Strecker 6d7647c890 Make windows config location more sensible 2018-12-27 14:16:31 +00:00
Matt T. Proud f0180430df Report Windows panics through MessageBox
Alacritty is often spawned through the executable on
Windows. Since this doesn't allow access to the stderr
and crashes on startup are more common on Windows
due to the agent, it can be hard to troubleshoot issues.

This reports all Alacritty crashes through error popups
on Windows, which should resolve the problem of
crashing Alacritty instances without any error feedback.
2018-12-23 22:36:06 +00:00
skliew c47c52d844 Send alt key with actual key in one flush
The delay between the alt key and the actual received key might cause
certain key sequences to be missed, ex. when tmux has its escape-time
set to 0.
2018-12-20 00:33:42 +00:00
Christian Duerr cf9d94eb12
Add color option to visual bell
This adds the option to specify the color of the visual bell using the
`visual_bell.color` configuration setting.

This is done by rendering a big quad over the entire screen, which also
opens up options to draw other arbitrary rectangles on the screen in the
future.
2018-12-17 19:06:07 +00:00
Steve Blundy 0c3e28617a Fixing tabs in copy-paste
This resolves issues with copy-pasting tabs by including them in the
pasted string.

Selection of tabs is still inconsistent with what might be expected
based on other terminal emulators, however the behavior hasn't
regressed.

This fixes https://github.com/jwilm/alacritty/issues/219.
2018-12-15 21:33:33 +00:00
dm1try 53c7489217 Ignore result on deregistering pty
Fixes #1897.
2018-12-14 03:54:05 +00:00
Kyle Rooker 0a73312c3d Fix color issues in ncurses programs
Certain programs like `htop` have problems with the number
of color pairs which are specified by the Alacritty terminfo
file. 

By reducing the maximum number of color pairs to the value
which is specified by xterm-256color, these issues are
resolved.

This fixes #1862.
2018-12-12 14:12:59 +00:00
Christian Duerr 7ab0b44847
Bump version to 0.2.4 2018-12-09 23:28:29 +00:00
Christian Duerr 1cebcd660b
Fix rendering of zero-width characters
Instead of rendering zero-width characters as full characters, they are
now properly rendered without advancing the cursor.

Because of performance limitations, this implementation only supports up
to 5 zero-width characters per cell. However, as a result of this
limitation there should not be any performance impact.

This fixes #1317, fixes #696 and closes #1318.
2018-12-09 15:28:22 +00:00
Tezkerek aef38d6c2f Change missing config log level to info 2018-12-08 20:51:36 +00:00
Vineeth Sagar cadbb86eb7 Detach Child process to avoid zombie processes
This makes use of the common double-fork behavior to prevent
spawning zombie processes every time a URL is clicked.
2018-12-06 21:38:34 +00:00
Bjorn Neergaard 0d2f5b0f0f Launch a login shell by default on macOS 2018-12-03 22:26:59 +00:00
Barret Rennie ca9a259caa Request user attention when bell received in macOS
We now request the user's attention in macOS when a visual bell
character is received. This manifests as the window jumping up and down
in the dock.
2018-12-02 16:11:51 +00:00
Christian Duerr e690a1444e
Add change log entries for macOS privacy requests 2018-12-02 17:07:23 +01:00
Zac Pullar-Strecker 742a6b48a1
Fix for an underflow on some type conversions (#1715) 2018-11-25 10:08:02 +13:00
Jonathan Dahan 2ede659134 Add option for launching Alacritty maximized 2018-11-19 21:23:47 +00:00
Ilya Epifanov fc04bc1e6d Changed path to standard /usr/bin/..., registered as an x-terminal-emulator alternative 2018-11-19 09:24:22 +00:00
Christian Duerr 42d8989916
Add keybinding action for clearing warns/errors
Since running `clear` inside of tmux doesn't actually clear any part of
the screen, but just resets the scrolling region, the warning and error
notices can't be removed without quitting tmux or Alacritty.

As a solution, a new action `ClearLogNotice` has been added which has
been bound to Ctrl+L by default. As a result, Ctrl+L can be used inside
of tmux to remove the messages, even though tmux doesn't clear the
screen.

This fixes #1811.
2018-11-19 08:33:48 +00:00
Christian Duerr 6265ef91d5
Display errors and warnings
To make sure that all error and information reporting to the user is
unified, all instances of `print!`, `eprint!`, `println!` and
`eprintln!` have been removed and replaced by logging.

When `RUST_LOG` is not specified, the default Alacritty logger now also
prints to both the stderr and a log file. The log file is only created
when a message is written to it and its name is printed to stdout the
first time it is used.

Whenever a warning or an error has been written to the log file/stderr,
a message is now displayed in Alacritty which points to the log file
where the full error is documented.

The message is cleared whenever the screen is cleared using either the
`clear` command or the `Ctrl+L` key binding.

To make sure that log files created by root don't prevent normal users
from interacting with them, the Alacritty log file is `/tmp/Alacritty-$PID.log`.

Since it's still possible that the log file can't be created, the UI
error/warning message now informs the user if the message was only
written to stderr. The reason why it couldn't be created is then printed
to stderr.

To make sure the deletion of the log file at runtime doesn't create any
issues, the file is re-created if a write is attempted without the file
being present.

To help with debugging Alacritty issues, a timestamp and the error
level are printed in all log messages.

All log messages now follow this format:
    [YYYY-MM-DD HH:MM] [LEVEL] Message

Since it's not unusual to spawn a lot of different terminal emulators
without restarting, Alacritty can create a ton of different log files.

To combat this problem, logfiles are removed by default after
Alacritty has been closed. If the user wants to persist the log of a
single session, the `--persistent_logging` option can be used. For
persisting all log files, the `persistent_logging` option can be set in
the configuration file
2018-11-17 14:39:13 +00:00
Christian Duerr d68ecb0def
Add option for dynamic padding (#1780)
This adds the `window.dynamic_padding` option which allows disabling the
dynamic spread of additional padding around the grid's content.

Based on the feedback I've gotten so far and the fact that most other
terminal emulators do not seem to center the content inside themselves,
I've changed the default configuration option to disable centering of the grid.

This fixes #1778.
2018-11-15 19:57:15 +00:00
Christian Duerr bf71d532b0
Add change log entry for scale_with_dpi setting 2018-11-14 20:37:54 +00:00
Christian Duerr 521d2f6a2c
Bump version to 0.2.3
Since the version 0.2.2 had some significant breakage which affects a
large number of users, this 0.2.3 release aims at providing a stable
release which works for everyone without any major regressions.
2018-11-13 16:06:33 +00:00
Christian Duerr d05d16f023
Fix incorrect padding calculations
The extra window padding was calculated in the renderer which lead to
problems with the paddings calculated in the `src/display.rs` and
`src/term/mod.rs`.

As a solution, every instance of `config.padding().x/y` has been removed
from the renderer (`src/renderer/mod.rs`), instead the padding is always
passed through from the `src/display.rs`.

The initial calculations during display creation and after resize then
are scaled appropriately and then the extra padding is calculated. As a
result every other location can just make use of the correctly
calculated `size_info.padding_x` and `size_info.padding_y`.

The documentation has been changed to clearly state that the padding is
scaled by DPI now.

This fixes #1773.
2018-11-12 18:23:23 +00:00
Christian Duerr f182afafe5
Bump version number to v0.2.2 2018-11-11 22:16:53 +00:00
Christian Duerr 6a0bd7409d
Center the grid inside the window
Currently alacritty always puts the grid at the top-left position of the
window. The only distance to the top-left window border is set by the
padding in the config.

However the grid always has a fixed size, and if a cell doesn't
completely fit the screen anymore, the padding at the bottom right
window corner can be significantly bigger than the padding at the top
left.

To fix this whenever there is more space left and there would usually be
a bigger padding at the bottom right, the space is now split up and
added to the padding.

This should always center the grid inside the window and make sure all
borders have the same padding from the text area.

This screenshot shows how it has been until now:
![Before](https://u.teknik.io/kRJwg.png)

Here is how it looks now:
![After](https://u.teknik.io/m4puV.png)

This fixes #1065.
2018-11-11 20:24:41 +00:00
Christian Duerr dba3cccf69
Set env variables before window start
The environment variables specified in the configuration file are now
all set before the window is created. As a result, this makes it
possible to add the `WINIT_HIDPI_FACTOR` env variable directly to the
Alacritty configuration.

This fixes https://github.com/jwilm/alacritty/issues/1768.
2018-11-11 12:55:28 +00:00
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 36f376fea8 Capitalization changes in README.md (#1757) 2018-11-07 09:49:13 -08: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 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
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
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
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