Commit graph

114 commits

Author SHA1 Message Date
Daniel Eklöf
18827ebe0b
changelog: mention fix for 'too many wl_surface_damage_buffer()' calls 2020-07-13 15:10:03 +02:00
Daniel Eklöf
0bdbf45418
changelog: hollow cursor is now based on keyboard focus, not visual focus 2020-07-11 18:43:50 +02:00
Daniel Eklöf
3397e735a5
changelog: add multi-seat support 2020-07-09 09:17:42 +02:00
Daniel Eklöf
db7a51e3a4
changelog: grammar 2020-06-30 17:46:25 +02:00
Daniel Eklöf
a259eda535
config: add 'blink' option to cursor section in footrc
This option controls whether the default cursor should blink or
not. The default is to *not* blink.
2020-06-30 17:45:34 +02:00
Daniel Eklöf
7f65bd1c20
csi: '\E[0 q' resets the cursor style to the default, not '\E[2 q'
Also update 'Se' capability in the terminfo, to reflect this.
2020-06-30 17:44:43 +02:00
Daniel Eklöf
fad5838dba
Merge branch 'master' into sixel-performance 2020-06-29 22:03:26 +02:00
Daniel Eklöf
62be729c45
scroll: destroy scrolled out sixels before scroll is applied
The logic that breaks out of sixel loops does not work for rows that
has already wrapped around.

Thus, we need to destroy sixels that are about to be scrolled
out *before* we actually scroll.

Since this is the *only* time we destroy sixels (instead of
overwriting it), rename the sixel functions. And, since they now do a
very specific thing, they can be greatly simplified (and thus faster).
2020-06-29 22:01:02 +02:00
Daniel Eklöf
a136987678
reflow: ensure sixels are correctly sorted when re-inserted
And make sure to remove re-inserted sixels that has wrapped around the
scrollback (this may happen when the window size decreases).
2020-06-29 21:59:40 +02:00
Daniel Eklöf
6ee76c21f2
changelog: group sixel related changes toghether 2020-06-29 21:57:01 +02:00
Daniel Eklöf
8f5e6e85e0
sixel: destroy all sixels when font size is decreased
If changing the font size causes the cell size to decrease, either
horizontally or vertically (or both), then delete all sixels since the
grid space they allocated no longer is enough to hold the images.
2020-06-29 21:53:29 +02:00
Daniel Eklöf
2c4ebec4da
changelog: slave -> client 2020-06-29 21:53:07 +02:00
Daniel Eklöf
b56dbfa854
changelog: 'capturing mouse events' -> 'capturing the mouse' 2020-06-29 21:52:50 +02:00
Daniel Eklöf
a6d35d41c4
changelog: make it easier to read 2020-06-29 21:52:32 +02:00
Daniel Eklöf
2ea32398c3
term: use 'left_ptr' instead of 'hand2' as cursor when client is mouse grabbing 2020-06-29 21:51:53 +02:00
Daniel Eklöf
ad8f293d96
terminfo: add remaining keypad keys 2020-06-27 20:05:50 +02:00
Daniel Eklöf
26528f6a73
input: add key mapping for XKB_KEY_KP_Decimal 2020-06-27 20:03:41 +02:00
Daniel Eklöf
9f31cfa764
terminfo: add ka1, ka3, kc1 and kc3 (upper/lower left/right keypad keys) 2020-06-27 19:39:27 +02:00
Daniel Eklöf
851e99f9a5
terminfo: kb2 (center keypad key) should be \EOu, not \EOE 2020-06-27 19:38:53 +02:00
Daniel Eklöf
f976df6f4d
changelog: sixel images can now be printed on 2020-06-27 14:27:49 +02:00
Daniel Eklöf
f4fcdbf38b
sixel: hopefully fix erasing of scrollback wrap-around sixels
If a sixel image crossed the scrollback wrap around, the logic that
detected whether a row, or a row range, intersected with the sixel was
incorrect.
2020-06-27 11:00:28 +02:00
Daniel Eklöf
bae11000cc
term: reset: set title to the user configured title, not "foot" 2020-06-22 14:33:16 +02:00
Daniel Eklöf
c94cbdeb64
osc: set color: update both grids, but exclude scrollback 2020-06-14 09:34:46 +02:00
Daniel Eklöf
70c48091f3
changelog: language 2020-06-14 09:14:04 +02:00
Daniel Eklöf
dec796f525
sixel: if the client has specified a size, do not change that
We used to auto-resize images to always be a multiple of 6.

This is incorrect. The client may, for example, have specified a size
to align the image to a cell boundary, which may not be a multiple of
6.

Furthermore, in e.g. Jexer, which splits up an image into stripes,
that the next image would "overwrite" the previous one. Since the next
image was started on a cell row that the previous image had overflowed
into.
2020-06-11 18:40:52 +02:00
Daniel Eklöf
957e482f45
osc: 'Set Color' now updates already rendered cells in current grid
Since we don't have the original palette index in already rendered
cells, we compare the color *value*. If it matches, we assume this was
the color index used, and updates the cell's color.

Note that for performance reasons, we only update the current
grid. This is of course wrong, strictly speaking.

However, it is expected that _Set Color_ is used by full-screen
applications using the alternate grid.
2020-06-11 17:13:32 +02:00
Daniel Eklöf
cc5dedc259
sixel: do not reset palette after each image
A client can re-use the palette between images. Resetting the palette
breaks this.

Now we initialize the palette on demand, and resets it when the
palette size is changed (by the client).
2020-06-10 18:38:46 +02:00
Daniel Eklöf
f72c982c89
osc: don't assert on \E]4 being followed by a ';'
This fixes a crash (in debug builds) that could be triggered by
e.g. cat:ing /dev/urandom.
2020-06-09 17:33:26 +02:00
Daniel Eklöf
bf57d0c606
csi: \E[3J: reset render.last_cursor.row if necessary
This fixes a crash that occurred when the last rendered cursor cell
had scrolled off screen, and \E[3J (clear scrollback) was executed.
2020-06-09 17:32:34 +02:00
Daniel Eklöf
fb001ee7a7
unicode combining: don't log overflow errors unless LOG_ENABLE_DBG == 1 2020-06-09 17:31:58 +02:00
Daniel Eklöf
21e9031420
sixel: don't erase image when printing text *next* to it. 2020-06-06 13:59:46 +02:00
Daniel Eklöf
6bf1287292
changelog: mention fix for glyphs overflowing into surrounding cells 2020-06-03 17:40:55 +02:00
Daniel Eklöf
29630ac92e
term: set an initial TIOCSWINSZ right after opening the pty
Since foot is pretty aggressive about spawning the client early, it
was possible for a fast client to read a 0x0 terminal size. Not all
clients coped well.

Closes #20.
2020-06-02 19:59:28 +02:00
Daniel Eklöf
8f37c839f3
render: draw hollow block cursor on top of the character, not the opposite 2020-06-02 18:22:55 +02:00
Daniel Eklöf
056fd4ffe0
selection: don't allow only half of double-width characters to be selected 2020-06-02 18:21:39 +02:00
Daniel Eklöf
e02121ae24
changelog: mention addition of '--hold' to footclient 2020-05-26 20:12:53 +02:00
Daniel Eklöf
e310487dae
slave: set IUTF8 2020-05-26 18:18:11 +02:00
Daniel Eklöf
29ac0278b1
changelog: is -> are 2020-05-21 20:28:26 +02:00
Daniel Eklöf
c605503df6
slave: restore signal mask 2020-05-21 20:22:24 +02:00
Daniel Eklöf
789617d5ad
term: don't double fork new terminal windows
Instead, register their PIDs with the new reaper module and let it
handle them.
2020-05-21 20:17:29 +02:00
Daniel Eklöf
483ea4ae73
scrolling: fix crash when offset was exactly at the wrap-around
When making sure we don't scroll past the scrollback history, and the
current offset was exactly at the wrap around, the new view port was
set to offset+1, which in this particular case meant outside the valid
row numbers.
2020-05-19 18:51:56 +02:00
Daniel Eklöf
08588cd0fc
selection: handle viewport wrap around correctly
When the viewport wraps around, the selection points may be
"incorrect".
2020-05-19 18:49:42 +02:00
Daniel Eklöf
96a4f1b993
term: scrolling: hopefully fix all selection/scrolling related crashes
When scrolling, there are a couple of cases where an existing
selection must be canceled because we cannot meaningfully represent it
after scrolling.

These are when the selection is (partly) inside:

* The top scrolling region
* The bottom scrolling region
* The new lines scrolled in. I.e. re-used lines

For the scrolling regions, the real problem is when the selection
crosses the scrolling region boundary; a selection that is completely
inside a scrolling regions _might_ be possible to keep, but we would
need to translate the selection coordinates to the new scrolling
region lines.

For simplicity, we cancel the selection if it touches the scrolling
region. Period.

The last item, newly scrolled in lines is when the selection covers
very old lines and we're now wrapping around the scrollback history.

Then there's a fourth problem case: when the user has started a
selection, but hasn't yet moved the cursor. In this case, we have no
end point.

What's more problematic is that when the user (after scrolling) moves
the cursor, we try to create a huge selection that covers mostly
empty (NULL) rows, causing us to crash.

This can happen e.g. when reverse scrolling in such a way that we wrap
around the scrollback history.

The actual viewport in this case is something like `-n - m`. But the
selection we'll end up trying to create will be `m - (rows - n)`. This
range may very well contain NULL rows.

To deal with this, we simply cancel the selection.
2020-05-17 15:34:49 +02:00
Daniel Eklöf
a4f5938123
term: scrolling: clamp number of rows to number of rows in scrolling region 2020-05-16 23:44:54 +02:00
Daniel Eklöf
6902c22a77
selection: copy: insert line break if either cell is empty 2020-05-16 22:29:53 +02:00
Daniel Eklöf
1a8ccb0ffa
selection/render: sync cells' 'selected' bit before rendering
For performance reasons, we track whether a cell is selected or not
using a bit in a cell's attributes.

This makes it easy for the renderer to determine if the cells should
be rendered as selected or not - it just have to look at the
'selected' bit instead of doing a complex range check against the
current selection.

This works nicely in most cases. But, if the cell is updated, the
'selected' bit is cleared. This results in the renderer rendering the
cell normally, i.e. _not_ selected.

Checking for this, and re-setting the 'selected' bit when the cell is
updated (printed to) is way too expensive as it is in the hot path.

Instead, sync the 'selected' bits just before rendering. This isn't so
bad as it may sound; if there is no selection this is a no-op. Even if
there is a selection, only those cells whose 'selected' bit have been
cleared are dirtied (and thus re-rendered) - these cells would have
been re-rendered anyway.
2020-05-16 21:36:08 +02:00
Daniel Eklöf
e4a2d41f51
selection: don't automatically no-op operations if selection isn't enabled
When the client is capturing the mouse, selection can only be done by
holding done shift.

This is why a lot of selection functions are no-ops if selection isn't
currently enabled.

However, there are many cases where we actually need to modify the
selection. In particular, selection_cancel().

Thus, only check for enabled selection when we're dealing with user
input.

Bonus: this also fixes a bug where an ongoing selection were finalized
as soon as the user released shift, even if he was still holding down
the mouse button.
2020-05-16 21:16:11 +02:00
Daniel Eklöf
b647aa447b
render: only apply transparency to the default background color 2020-05-16 16:26:52 +02:00
Daniel Eklöf
6deae0b07a
terminfo: add tmux extension 'Sync' - indicates 'Synchronized Updates' support 2020-05-16 14:13:45 +02:00
Daniel Eklöf
0955cee902
changelog: prepare for the next, unreleased version 2020-05-13 13:22:19 +02:00