Commit Graph

10 Commits

Author SHA1 Message Date
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
Cole Helbling e240da9ab3 Add option for window position at startup 2019-03-11 12:35:49 +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 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
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
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