Commit Graph

188 Commits

Author SHA1 Message Date
Dustin a75e949344 Fix window title not filled by default
In the config, if `window` is undefined, the derived `Default` for the
String `title` is used, which is an empty String. This was unintended,
and causes issues in gnome-shell (e.g. in the alt-tab dialog) when the
window title is an empty string.

This commit adds a manually implemented default for the `WindowConfig`,
it's the same as the derived `Default`, except for the `title`, which
will now always be "Alacritty" as originally intended.
2019-10-17 21:24:21 +02:00
Christian Duerr 1538f09e0c
Print launch command name on failure 2019-10-15 22:53:25 +02:00
Aleksey Kuznetsov 49380bffd2 Add support for alternate scroll escape
Fixes #2727.
2019-10-15 21:13:58 +02:00
Dustin 401c2aab96 Add support for title stack escape sequences
This commit adds the concept of a "title stack" to the terminal. Some programs
(e.g. vim) send control sequences `CSI 22 ; 0` (push title) and `CSI 23 ; 0`
(pop title).

The title stack is just a history of previous titles.  Applications can push
the current title onto the stack, and pop it back off (setting the window title
in the process).

Fixes #2840.
2019-10-14 19:50:58 +02:00
Valentin Ignatev 4cb5566a9c Add --hold CLI flag
This implements --hold flag which keeps Alacritty open after
its child process exits.

Fixes #1165.
2019-10-09 23:37:48 +02:00
Kirill Chibisov 24651a6144 Remove automatic config generation
Fixes #2818.
2019-10-06 12:47:20 +02:00
Christian Duerr 729eef0c93
Update to winit/glutin EventLoop 2.0
This takes the latest glutin master to port Alacritty to the EventLoop
2.0 rework.

This changes a big part of the event loop handling by pushing the event
loop in a separate thread from the renderer and running both in
parallel.

Fixes #2796.
Fixes #2694.
Fixes #2643.
Fixes #2625.
Fixes #2618.
Fixes #2601.
Fixes #2564.
Fixes #2456.
Fixes #2438.
Fixes #2334.
Fixes #2254.
Fixes #2217.
Fixes #1789.
Fixes #1750.
Fixes #1125.
2019-10-05 02:29:26 +02:00
wayne f6f444bc2d Add live config reload for font size 2019-10-02 20:49:19 +02:00
Paolo Capriotti 3e82aa2830 Concatenate parameters of title OSC
A semicolon in a title OSC should be interpreted literally, not as a parameter
separator, but the OSC parser is very simple and does not know about arities of
commands.

Therefore, this patch takes all the parameters returned by the OSC parser and
reconstructs the original string by interspersing semicolons. Now an OSC like
'\e]2;hello;world' will set the title to 'hello;world' and not 'hello' like
before.
2019-09-28 18:59:27 +02:00
zsugabubus fe6f1760b4 Add `ReceiveChar` action for passing key's text 2019-09-28 02:37:22 +02:00
Christian Duerr 87cf14a4b7
Fix selection not inverting terminal background
Fixes a regression introduced in
9a0555bbba where the terminal background
would not get inverted when selected.
2019-09-26 20:55:30 +02:00
Kirill Chibisov 9a0555bbba Fix cell opacity when color matches terminal bg
Commit e964af8 introduced a regression, where if cell's bg color was
equal to NamedColor::Background rgb color it was rendered with transparent
background. However the correct behavior is to render bg transparent
only when bg color is actually a NamedColor::Background.

Fixes #2814.
2019-09-26 16:10:54 +02:00
Kirill Chibisov ad24485cdb Fix overflow on wrong scroll region setting
Fixes #2822.
2019-09-26 14:44:59 +02:00
mkosem c1f089970f Add Xembed support
Fixes #631.
2019-09-24 19:43:54 +02:00
Christian Duerr 856cddc873
Remove outdated TODO/FIXME comments 2019-09-21 19:54:32 +02:00
Christian Duerr 71a818cb8f
Initialize only visible characters
This fixes an off-by-two error in the renderer which initializes
characters 32 until 128 (inclusive) for each font whenever it is loaded.
The ascii visible range however just goes from 32 until 126 (inclusive).
2019-09-19 23:15:06 +02:00
Kirill Chibisov 9a14ca42d3 Rework default bindings
This commit removes all bindings which are sending escapes from
the default configuration file, adds bindings for F13-F24, adds bindings
for ScrollToTop/ScrollToBottom actions, removes bindings for Super + F1-F12,
fixes bindings for Alt + F1-F12.

Fixes #2688.
2019-09-18 21:21:01 +02:00
Christian Duerr 52fecd71b9
Remove code for setting _NET_WM_PID
This code is no longer necessary since winit now does this for us.
2019-09-16 17:10:12 +02:00
Christian Duerr c42df41332
Fix bindings incorrectly getting replaced
Fixes #2794.
2019-09-16 17:02:29 +02:00
Christian Duerr fb37a9cb55
Fix empty block selection detection
Fixes #2789.
2019-09-13 23:51:14 +00:00
Matthias Krüger 1067fa609b Replace uninitialized with MaybeUninit 2019-09-10 16:08:01 +00:00
Nathan Lilienthal 86ffa181b3 Reset the Mouse Cursor While Selecting
This change disabled the mouse cursor and URL highlight (underline)
while a selection is in progress. A click to clear the selection doesn't
trigger a URL action, but will re-enable the URL highlighting to
indicate the next click will trigger the launcher.
2019-09-09 20:39:39 +00:00
Bastien Orivel 20846ef925 Update and dedupe parking_lot to 0.9 2019-09-06 19:35:28 +00:00
Christian Duerr 4ccda1aaa5
Fix legacy xparsecolor regression
The legacy xparsecolor implementation assumed that the \007 ending would
be passed to the parser, however it never is. This caused colors in the
format #rrggbb to be interpreted as #rrggb, leading to incorrect colors
showing up in Alacritty.

Fixes #2759.
2019-08-28 18:12:10 +02:00
Christian Duerr 5f7fb4c3e2
Fix url highlight not showing with required modifiers 2019-08-26 18:11:36 +02:00
Chris Morgan e69f259d0e
Add bold italic font support
If the terminal escape sequences for bold and italic text are active,
the text should be rendered as bold and italic. However, due to missing
support in Alacritty, it would always render this text in bold.

This adds support for combining the bold and italic escapes to render
text in both styles and allows users to override the font for this
scenario using the `font.bold_italic` configuration option.
2019-08-25 14:30:42 +02:00
John Sullivan ad0365219f Show text cursor when pressing shift in mouse mode
Fixes #2550.
2019-08-24 23:18:50 +00:00
rbong 629ea247cd Follow xparsecolor spec in escape sequences
Escape sequences in xterm are parsed according to xparsecolor.
xparsecolor supports 1, 2, 3, and 4 digit hex colors.
Previously, only 2 digits were supported.

This also fixes a bug where "fX" was parsed as "0xf", where X is an invalid character.

The response to a request for fg/bg must be a valid escape sequence.
The current response uses 4-digit hex, which was previously invalid.
2019-08-19 19:56:27 +00:00
Bastien Orivel a8692983f5 Update depedencies 2019-08-18 02:46:29 +00:00
Christian Duerr d9d698614c
Fix clippy issues 2019-08-16 01:33:49 +02:00
Kirill Chibisov 1da986ae2b
Fix smithay-clipboard integration
Fixes: #2574
2019-08-16 01:33:37 +02:00
Christian Duerr 5cf77bf250
Format code 2019-08-08 23:30:10 +02:00
Koichi Murase 33cfc52909 Ignore unsupported CSI sequences
Instead of ignoring unexpected intermediates in CSI escape sequences,
the intermediates are now explicitly checked and the escape sequence is
rejected when an unexpected intermediate is found.

Fixes #2171.
2019-08-06 22:59:16 +00:00
Kirill Chibisov b20d285782 Fix multiple underlines/strikeouts on the same line
This commit fixes regression introduced in ddee14a.
2019-08-06 22:46:02 +00:00
Christian Duerr 14fa02648e
Remove errno depedency 2019-08-04 20:17:22 +00:00
Christian Duerr ddee14a6ef
Fix lines in last line not rendered when scrolled up
Instead of creating the rectangles for lines after the line is
completed, the rectangle is now initialized as soon as it is started.
Then when following cells also contain the same line type, the rectangle
is updated.

This resolves the problem of having to finish the last line when it ends
in the last non-empty column in the last line, since the render iterator
only returns non-empty cells and we never get the information that the
underline has ended.

Fixes #2680.
2019-08-04 19:40:57 +00:00
Kirill Chibisov e1892ee92a Fix crash when hovering over message bar
This commit fixes a regression introduced in 9dddf64.

Fixes #2699.
2019-08-04 16:01:08 +00:00
Christian Duerr 5a40149069
Move modifier check before URL search
This makes sure that the URL search is only initiated when all required
modifiers are held down. This should improve performance with long URLs.
2019-08-03 13:19:33 +00:00
Christian Duerr 9dddf649a1
Switch to rfind_url for URL detection
This switches to rfind_url for detecting URLs inside the grid. Instead
of expanding at the cursor position, the complete terminal is searched
from the bottom until the visible region is left with no active URL.

Instead of having the field `cur` publicly accessibly on the
`DisplayIterator`, there are the two methods `DisplayIterator::point`
and `DisplayIterator::cell` for accessing the current element of the
iterator now. This allows accessing the current element right after
creating the iterator.

Fixes #2629.
Fixes #2627.
2019-08-01 15:37:01 +00:00
Christian Duerr f51c7b067a
Remove color from log output
Fixes #2474.
2019-08-01 14:26:55 +00:00
Christian Duerr 86b9cdbabe
Bump minimum supported Rust version to 1.34.0 2019-07-30 22:13:51 +00:00
Kirill Chibisov 72dfa477a9 Fix cursor flickering on url hover
This commit fixes the regression introduced in 84aca67 and also fixes url
highlight bounds computation when url ends on a last column.

Fixes #2665.
2019-07-28 17:04:26 +00:00
Wild Kat 14a48a2533 Update gl_generator to 0.13 2019-07-28 17:03:52 +00:00
Ben Firth 54dca06bfb Fix double-click selecting trailing tab
Fixes #2639.
2019-07-26 11:18:47 +00:00
Christian Duerr a23b372f34
Fix NetBSD build failure
Fixes #2631.
2019-07-22 18:56:08 +00:00
Mihyaeru 76dd84bef8 Remove redundant use statement on macOS 2019-07-16 15:45:46 +00:00
Christian Duerr 3c3239b1cb
Override default bindings with subset mode match
Fixes #2641.
2019-07-15 21:32:48 +00:00
Kirill Chibisov 9a159a7760 Fix cursor color setting with escape sequence
The cursor rework introduced a regression where cursor color was always picked
from a config file, rather then using `ansi::NamedColor::Cursor` for this
purpose.

This commit also removes `CursorText` option from `NamedColor` enum,
since we can't speculate with `CursorText` during runtime.

Cursor rework commits:
  cfc20d4f34
  371d13f8ef
  0d060d5d80
2019-07-10 21:24:04 +00:00
Christian Duerr c4d2725e14
Fix row occ not set during new and reset
Since ref tests were only stored whenever winit requested the window
close, they would not get stored properly when the terminal was closed
through Alacritty using `exit`, Ctrl+D or similar.

This moves the ref test code to the and of the main entry point, which
will always be executed regardless of how the terminal was shutdown.

Fixes #2613.
2019-07-10 21:17:20 +00:00
Kirill Chibisov a99547cc6d Fix mouse move handling
This commit fixes the regression introduced in
84aca67296.

Fixes #2635.
2019-07-10 18:27:43 +00:00
Elaina Martineau 84aca67296 Change mouse cursor when hovering over the message bar 2019-07-08 18:13:55 +00:00
Christian Duerr 165246f50a
Fix saving of ref tests
Since ref tests were only stored whenever winit requested the window
close, they would not get stored properly when the terminal was closed
through Alacritty using `exit`, Ctrl+D or similar.

This moves the ref test code to the and of the main entry point, which
will always be executed regardless of how the terminal was shutdown.
2019-07-07 14:51:11 +00:00
Kirill Chibisov ed7ed473da Fix doc box drawing symbols 2019-07-07 13:14:04 +00:00
Brian Koropoff 228c641769 Allow setting gtk variant and general class on X11 2019-07-06 19:34:56 +00:00
Christian Duerr af30f3735a
Fix rows only resetting partially
This resolves an issue with rows only resetting partially, based on
their `occ` state. However this state is not always accurate, so more
than just the occupied elements need to be cleared.

Fixes #2340.
2019-06-28 20:19:15 +00:00
Kirill Chibisov 0815774cbf Perform clear and buffer swap before showing window
This should fill window with background color while it is offscreen instead of
showing it with uninitilized surface and then performing `clear`. So, the new
behavior should prevent glitches during startup. e.g. content of the windows
below, garbage from drivers and so on.
2019-06-25 21:34:55 +00:00
Christian Duerr e2e25b3206
Fix first unfullscreen on fullscreen mode launched window 2019-06-25 21:32:28 +00:00
Christian Duerr f002171c84
Fix performance issues with text reflow
Fixes #2567.
Fixes #2414.
2019-06-23 23:29:01 +00:00
Kirill Chibisov 72088dafec Fix inconsitent cursor position when scrolling
This commit fixes regression introduced in cfc20d4f34.
`self.cursor.line` forced the cursor to hold a fixed location while scrolling
until its "original" location (usually the shell prompt) went off the screen.
So cursor position should be keep updated, which can be achieved by using
`self.inner.line()`.

Fixes #2570.
2019-06-21 23:00:01 +00:00
Christian Duerr e0a286515f
Add block selection
This implements a block selection mode which can be triggered by holding
Control before starting a selection.

If text is copied using this block selection, newlines will be
automatically added to the end of the lines.

This fixes #526.
2019-06-20 15:56:09 +00:00
Matthias Krüger 4039f72000 Fix redundant static lifetime clippy lint 2019-06-18 21:23:03 +00:00
Christian Duerr fe4cfdc545
Unset DESKTOP_STARTUP_ID environment variable
This unsets the DESKTOP_STARTUP_ID environment variable at startup, to
prevent child processes from inheriting it. This solves problems with
child windows not properly spawning in the foreground with KDE.

More information can be found here:
https://specifications.freedesktop.org/startup-notification-spec/startup-notification-latest.txt
2019-06-16 16:03:52 +00:00
Christian Duerr cc3e4d3d5c
Bump version to 0.3.3 2019-06-16 14:10:15 +00:00
Christian Duerr 8ea28eb1b0
Bump version to 0.3.3-rc2 2019-06-15 21:34:13 +02:00
Christian Duerr 1b26059a06
Bump smithay-clipboard dependency version 2019-06-15 19:08:51 +00:00
Christian Duerr d3cc9743b7
Fix dynamic color escape response
The dynamic color escape response would answer to requests with
rgb:0/0/0 when the color was completely black, instead of properly
responding with double-digit hex colors. This has been changed so that
Alacritty now always properly responds with the same number of hex
digits for all colors.

The number of digits has also been changed from two to four digits per
color, since that is the more commonly used format.

Using the `write!` macro was also causing problems with NeoVim,
since it caused Alacritty to write the dynamic color escape in multiple
write calls, switching to `write_all` fixed that.

Fixes #2543.
2019-06-15 16:52:23 +00:00
Christian Duerr 0b88b9fee4
Bump version to 0.3.3-rc1 2019-06-09 22:10:42 +02:00
Kevin Zheng 204c46c7f9 Fix dynamic multi-color escape codes 2019-06-09 18:02:15 +00:00
Matthias Krüger f59aa19892 Fix compiler warnings 2019-06-09 17:52:48 +00:00
Christian Duerr bc2c34eb7f
Add wayland primary selection clipboard support 2019-06-09 11:46:31 +00:00
Christian Duerr f15ef63edb
Fix index out of bounds during selection
This reworks the selection logic to prevent any possible index out of
bounds exceptions by clamping the start and end points before doing
anything else with them when converting selections to spans.

This also fixes a bug where semantic selections would not automatically
expand across double-width characters.

Fixes #2486.
2019-06-06 13:04:12 +00:00
Elaina Martineau 45565bb9ca Re-invert cursor when in selection 2019-06-06 00:02:20 +00:00
rbong f79007035c Add foreground/background request escape codes 2019-06-02 13:16:38 +00:00
Jacob Evan Shreve 29c037e3c5 Allow URLs to end with trailing slash 2019-05-19 19:24:00 +00:00
Christian Duerr d934df6c0e
Fix URL detection matching invalid URLs
Fixes #2450.
2019-05-16 21:05:00 +00:00
Kirill Chibisov f93a84aef4 Fix message bar not updating PTY size on hide 2019-05-13 23:06:19 +00:00
Jean Mertz 1656aff85e Add support for double-click bracket-pair selection 2019-05-11 16:15:32 +00:00
Elaina Martineau ca9724a5ef Fix cursor only showing up over left half of wide characters 2019-05-11 15:57:22 +00:00
Christian Duerr 5d173f6df3
Refactor config parsing files
This is a large refactor of the config parsing structure, attempting to
reduce the size of the file a bit by splitting it up into different
modules with more specific purposes.

This also fixes #2279.
2019-05-10 11:36:16 +00:00
Nathan Lilienthal 34c54e7e0e
Add git hash to version string, and fix crate name (#2397)
This moves `cli` out of `alacritty_terminal` and into `alacritty` where
it belongs, along with the `clap` dependency.
2019-05-03 19:48:25 -04:00
Christian Duerr bc038f8295
Remove clipboard loading error logging
On macOS the clipboard actually returns an error when loading it and it
is empty. However this is not an `Empty` error but all errors are simple
boxed Errors from std.

Since loading the clipboard data usually should not fail, we now do not
log it as error if it fails but just print it to the debug log instead.

This fixes #2389.
2019-04-30 13:30:46 +00:00
Christian Duerr bf353059a0
Fix selection of double-width characters
This changes the selection behavior to automatically select both cells
of double width characters in either selection direction.

This fixes #2322.
2019-04-29 14:33:25 +00:00
Christian Duerr 21a97c1ef2
Fix mouse mode generate events without cell change 2019-04-28 22:36:02 +00:00
JDTX 2c462c7d03 Fix spelling mistakes 2019-04-28 21:42:43 +00:00
Christian Duerr 9e89aaa477
Switch from copypasta to rust-clipboard
This switches our own `copypasta` crate with the more standardized
`clipboard` library, which allows us to get rid of the `xclip`
dependency on X11.

Additionally, this lays the foundation for native Wayland clipboard
support once the clipboard crate is updated (or a fork is created).

Fixes #5.
2019-04-28 20:21:39 +00:00
Kirill Chibisov 37b66a7cd2 Set _NET_WM_ICON on X11 2019-04-28 18:12:35 +00:00
Elaina Martineau b321406908 Fix double-width characters in URLs only highlighting halfway 2019-04-28 16:09:26 +00:00
Theodore Dubois dbd8538762 Split alacritty into a separate crates
The crate containing the entry point is called alacritty, and the crate
containing everything else is called alacritty_terminal.
2019-04-28 13:24:58 +00:00