Commit Graph

188 Commits

Author SHA1 Message Date
Christian Duerr c84cd0fdb0
Fix first cell when selection is off screen
Since the expansion of the selection was done after clamping it to the
grid, the selection would incorrectly move the clamped start over by one
cell when the start was to the right of the original column. By
resetting the side of the start point to `Left` before expanding, this
can be circumvented.

This also resolves a regression which broke backwards bracket selection.

Fixes #3223.
2020-01-21 00:56:10 +01:00
Kirill Chibisov 5e22512fe6 Disable drawing bold text bright by default
Since the assumption is usually that bold text is drawn in bright
colors, this might break some applications. However some other terminals
have already taken this leap, which should lessen the impact for
Alacritty.

Since this might still be desired and necessary for certain
applications, the config option is just switched to draw with normal
colors by default, however the old behavior can still be restored.

Fixes #2779.
2020-01-20 22:13:39 +01:00
Kirill Chibisov 2f1a390aaa
Remove scrolling.auto_scroll feature
Fixes: #1873
2020-01-20 23:03:54 +03:00
Christian Duerr 7d1edf01c2
Expand line selection across wrapped lines 2020-01-15 17:36:33 +01:00
David Hewitt 7dc406252b Remove Windows working directory canonicalization
Fixes #3198.
2020-01-15 13:47:15 +01:00
Christian Duerr 12e211d82a
Bump VTE to 0.5.0
This change includes dynamic escape buffer support in VTE, which allows
us to have arbitrary escape sizes.

Since tmux could potentially use very long escapes for the clipboard
escape, this allows copying more text.

Fixes #1002.
2020-01-12 17:28:40 +01:00
Christian Duerr 09ed64bd36
Fix crash with invalid working directory 2020-01-12 01:24:56 +01:00
Christian Duerr c2c8d6bf37
Move Alacritty to organization
This fixes various outdated links pointing to the old jwilm/alacritty
repository.

Since `copypasta` now has its own github repository at
https://github.com/alacritty/copypasta, the sources have been removed
from Alacritty.
2020-01-11 02:23:13 +01:00
Christian Duerr c34ec12c30
Bump glutin to 0.22.0
Fixes #3165.
2020-01-10 01:51:37 +00:00
Christian Duerr 3fb631b91c
Fix cut off full width glyphs in last column
This resolves the issue with full width glyphs getting rendered in the
last column. Since they need at least two glyphs, it is not possible to
properly render them in the last column.

Instead of rendering half of the glyph in the last column, with the
other half cut off, an additional spacer is now inserted before the wide
glyph. This means that the specific glyph in question is then three
cells wide.

Fixes #2385.
2020-01-09 23:06:41 +00:00
Kirill Chibisov 7fd17ab0dd Bump version to 0.4.2-dev 2020-01-05 14:42:11 +00:00
Kirill Chibisov 5aaa350e1a Update outdated reftests 2020-01-04 23:55:10 +00:00
David Hewitt f632919134 Clean up Windows PTY string handling
Removes widestring and dunce dependencies, reduces some code duplication
and corrects a few typos.
2020-01-02 11:49:27 +00:00
Christian Duerr 77acb26d73
Remove C1 escape support
Fixes #2981.
2019-12-31 20:56:27 +00:00
Kirill Chibisov 3e6e8a03ee Move live-shader-reload feature to alacritty 2019-12-30 12:17:42 +00:00
Kirill Chibisov d4dc1f7b14 Remove outdated information from README 2019-12-29 22:48:27 +00:00
Christian Duerr 9da0c042d4
Fix screen reset not clearing cell flags 2019-12-24 20:51:06 +00:00
Kirill Chibisov 44037fa42a Fix crash on clear when scrolled up in history
Fixes #3112.
2019-12-22 11:05:19 +00:00
David Hewitt 85112fefa5 Remove unneeded NamedPipe::connect() calls
In the way the code was set up, these calls would always do nothing
and return io::ErrorKind::WouldBlock, so they can be safely removed.
2019-12-22 11:02:56 +00:00
David Hewitt 7a957978e4 Default to ConPTY instead of WinPTY 2019-12-21 21:23:18 +00:00
Christian Duerr 512461a241
Fix Windows CI build failure 2019-12-21 02:18:01 +01:00
sterlingjensen 8a83340661 Add conpty dynamic loading restrictions docs 2019-12-15 06:21:54 +01:00
David Hewitt 08a1225748 Send PTY resize messages through event loop
This allows us to clean up the Arcs on windows, as well as tidy up
the code on unix a little too.

Fixes #3086.
2019-12-14 22:32:24 +01:00
Christian Duerr cb99fd4e4c
Fix storage rotation error
This fixes a regression introduced in
e99057b179, which used `self.len` to
calculate the remainder of `self.zero` during rotation instead of
`self.inner.len()`, leading to a broken `self.zero` offset and incorrect
rotation.
2019-12-13 00:57:23 +01:00
Christian Duerr e99057b179
Fix crash when resizing Alacritty
Fixes #3088.
2019-12-12 16:02:07 +01:00
David Hewitt 6deb274b82 Fix deadlock when closing on Windows using Conpty
Fixes #3042.
2019-12-12 16:01:23 +01:00
Christian Duerr 36185c4753
Fix colored row reset performance
This fixes a bug where a row would always get reset completely if its
background does not equal the default terminal background. This leads to
big performance bottlenecks when running commands like `echo "\e[41m" &&
yes`.

Instead of resetting the entire row whenever the template cell is not
empty, the template cell is now compared to the last cell in the row.
The last cell will always be equal to the previous template cell when
`row.occ < row.inner.len()` and if `occ` is equal to the row's length,
the entire row is always reset anyways.

Fixes #2989.
2019-12-10 00:35:13 +01:00
sterlingjensen 72df0c06bf Remove unnecessary lifetimes from winpty 2019-12-05 18:14:47 +01:00
Christian Duerr a075c932f1
Fix `OSC 52` with empty clipboard param
This fixes the behavior of the clipboard escape (`OSC 52`) when the
second parameter is not specified. If it is missing, the parameter is
now assumed to be `c`, defaulting to the default clipboard.

This has been fixed both for writing and reading.

Fixes #3037.
2019-11-28 08:08:04 +01:00
Christian Duerr 94068956e6
Fix modifiers not getting released with XWayland
This resolves a winit bug where modifiers would stay pressed when they
were released outside of Alacritty when it was started in XWayland mode.
2019-11-23 19:23:00 +01:00
Kirill Chibisov 474032742b Move renderer from alacritty_terminal to alacritty 2019-11-23 18:08:52 +01:00
Christian Duerr ec3fa2b33a
Bump master to 0.4.1-dev
To make the release process a bit smoother and prevent a freeze of the
master process while review candidates are out, this will put the master
in a perpetual development state.

This should make it clear to everyone that the official source for
releases is always the tagged branch and make it possible to release new
versions completely independently.

Since versions are bumped after each release, this makes it so the
release branches do not have to get merged back into the master branch
to show the correct development version.
2019-11-19 21:34:34 +01:00
Christian Duerr 4b2be6d7b1
Remove tests failing in release mode 2019-11-19 19:02:10 +01:00
Nathan Lilienthal 182a9d5c2e Fix deletion of lines when clearing the screen
Previously Alacritty would delete lines when clearing the screen, leading to a
loss of data in the scrollback buffer. Instead of deleting these lines, they
are now rotated outside of the visible region.

This also fixes some issues with Alacritty only resetting lines partially when
the background color of the template cell changed.

Fixes #2199.
2019-11-18 22:15:25 +01:00
Kirill Chibisov bcdc605436 Fix ESC escapes not ignoring invalid intermediates
Previously, `ESC` escapes would ignore invalid intermediates and still
execute the specified actions, leading to false positives. If there's an
unexpected, intermediate specified now, the escape will be dropped.

This also fixes an issue with `CSI Ps c` not dropping the escape with
invalid intermediates.
2019-11-17 03:10:11 +01:00
Kirill Chibisov 495a6f3526 Fix cell reset not clearing flags and foreground
Fixes #2330.
2019-11-17 01:04:16 +01:00
Maciej Makowski 48861e4633 Fix WinPTY freeze on termination
Fixes #2889.
2019-11-16 22:11:56 +01:00
Christian Duerr d741d3817d
Add reftest for line deletion 2019-11-15 23:37:24 +01:00
Christian Duerr 2a8c6d44e9
Fix `CSI Ps M` deleting lines above cursor
Fixes #2984.
2019-11-15 20:58:03 +01:00
Burak Yigit Kaya 561063b560 Fix division by zero without any cols or lines
The URL check uses a division to wrap column indices across lines, which
will cause a runtime error if the size of the terminal is zero columns
wide.

Since a lot of our logic assumes that we at least have one column and
line to work with and our behavior doesn't matter otherwise, this change
fixes the terminal dimensions to have space for at least one cell.
2019-11-14 00:36:54 +01:00
Kirill Chibisov d707e064a9 Fix mouse modes not being mutually exclusive 2019-11-12 17:50:33 +01:00
Christian Duerr e8ca1ef7d9
Add escape for reading clipboard 2019-11-11 01:12:14 +01:00
Christian Duerr 0ac3481f83
Add ref test for verifying colored clear behavior
This covers the behavior of clearing the screen and a row with colored
cells.

This covers a bug discovered in #2329 which was not detected in any
existing ref tests.
2019-11-10 20:26:39 +01:00
Kirill Chibisov 2c671afb69 Add UTF-8 mouse mode support
Fixes #1934.
2019-11-04 20:41:13 +01:00
Christian Duerr 93e87eb0f1
Fix incorrect cell foreground when clearing screen
This fixes a bug that would clear the cells with the current template
cell with just the `flags` reset, to make sure the colors are correct.
However, the cell foreground was not reset, leading to cells counting as
occupied when resizing.

With this change both cell flags and foreground color are ignored when
clearing both the whole screen and inside the line, allowing us to
accurately keep track of cell occupation.

Fixes #2866.
2019-11-04 00:14:23 +01:00
Christian Duerr b47a88b142
Fix URL highlighting
Fixes #2898.
Fixes #2479.
2019-11-03 21:59:28 +01:00
Christian Duerr 356e418636
Fix clippy warnings 2019-11-02 01:25:34 +01:00
Kirill Chibisov 9ff2838844 Fix visual bell rendering mode
Fixes #2911.
2019-10-26 21:45:47 +02:00
Kirill Chibisov d76bb0c697 Update dependencies 2019-10-23 21:17:09 +02:00
cyclopsian 8a26341457 Fix XEmbed compilation error on 32-bit platforms 2019-10-20 14:30:59 +02:00
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