Commit graph

2734 commits

Author SHA1 Message Date
Daniel Eklöf
323119a645
grid: reflow: re-insert sixels *after* new grid offset has been set
Also make sure to destroy sixels that are too big to fit in the scrollback.

Fixes issues with the sixel list not being sorted correctly.
2020-10-09 07:44:15 +02:00
Daniel Eklöf
5a6b96817d
sixel: overwrite: calculate split-up image pieces’ rows/cols from their width/height 2020-10-09 07:44:15 +02:00
Daniel Eklöf
a53a81cebf
sixel: overwrite: remove asserts
Sixels may extend outside the visible screen area
2020-10-09 07:44:15 +02:00
Daniel Eklöf
6cf86d67d9
term: re-calculate sixel images’ rows/cols values when cell size changes 2020-10-09 07:44:15 +02:00
Daniel Eklöf
bc75f4744c
sixel: fix sheared image when image crosses scrollback wrap-around
When a sixel image crosses the scrollback wrap-around, it is split up
into (at least) two pieces.

We use cursor->point.col for all pieces’ x-coordinate. This caused the
final image to appear sheared, since we do a carriage-return (after a
number of linefeeds) after each piece - this causes the cursor’s
position to be reset to the left margin.

The solution is simple; remember the cursor’s initial x-coordinate,
and use that to position all image pieces.

Closes #151.
2020-10-09 07:44:15 +02:00
Daniel Eklöf
96405c2ca9
sixel: overwrite-by-rectangle expects ‘width’ to not exceed screen
This fixes a crash when the emitted sixel extends beyond the right
margin. The crash only happens when there are other sixel images
already emitted.

Fixes part of #151
2020-10-09 07:44:13 +02:00
Daniel Eklöf
7e026ba119
sixel: fold long line 2020-10-09 07:43:57 +02:00
Daniel Eklöf
b10d93b0ef
Merge branch 'bell-triggers-faked-urgency' into master
Closes #157
2020-10-09 07:41:39 +02:00
Daniel Eklöf
f47d27968f
doc: foot.ini: bell/urgency: add note about this getting replaced in the future
The ‘set-urgency’ action is an interim workaround for lack of support
of an urgency hint in Wayland compositors. If/when such a feature gets
implemented in Wayland, I intend to use that instead of the current
implementation in foot.
2020-10-09 07:39:53 +02:00
Daniel Eklöf
7c6686221f
bell: optionally render margins in red when receiving BEL
Add anew config option, ‘bell=none|set-urgency’. When set to
‘set-urgency’, the margins will be painted in red (if the window did
not have keyboard focus).

This is intended as a cheap replacement for the ‘urgency’ hint, that
doesn’t (yet) exist on Wayland.

Closes #157
2020-10-08 19:55:32 +02:00
Daniel Eklöf
7e0cfd46c6
doc: foot.1: remove ‘--’ from example command line 2020-10-08 19:54:28 +02:00
Daniel Eklöf
4c242cacb3
doc: foot.ini: mention that ‘lines’ is rounded up to nearest power of 2 2020-10-08 19:54:06 +02:00
Daniel Eklöf
219dbad5b5
doc: foot.ini: “top at” -> “top of” 2020-10-08 19:53:49 +02:00
Daniel Eklöf
17d6e85e1c
doc: foot.ini: it’s foot.ini, not foot.init 2020-10-08 19:53:30 +02:00
Daniel Eklöf
279341dd8e
render: apply opacity correctly when in reverse video mode 2020-10-08 19:53:11 +02:00
Daniel Eklöf
2b3cfb525a
changelog: fix CSI escape sequence 2020-10-08 19:52:10 +02:00
Daniel Eklöf
2ebd7a3dd7
doc: foot.ini: the tweak section is called ‘tweak’, not ‘tweaks’ 2020-10-07 18:38:54 +02:00
Daniel Eklöf
b1bdc2d4c1
config: ignore key/value pairs following an invalid section name
When we detected an invalid section name, we correctly logged this and
warned the user.

However, the internal state machine now had an invalid section enum
value. This caused a crash when the next key/value pair was to be
parsed and we tried to lookup which parser function to call.

Closes #159.
2020-10-07 18:34:48 +02:00
Daniel Eklöf
4ac5df079a
readme: add link to the ‘Performance’ page on the wiki 2020-10-06 21:15:56 +02:00
Daniel Eklöf
9f9ad69849
term: cursor-left: unlikely -> likely for reverse-wrap
Since reverse wrap-around is enabled by default, we’re *likely* to
take this branch.
2020-10-06 19:05:11 +02:00
Daniel Eklöf
e36d907f3d
Merge branch 'reverse-wrap' into master
Closes #150
2020-10-06 19:03:20 +02:00
Daniel Eklöf
207b24538d
term: enable reverse wrap-around by default
Since we’re now doing reverse auto-wrapping by default, we add
‘bw’ (‘auto_left_margin’)to terminfo.
2020-10-06 18:42:26 +02:00
Daniel Eklöf
7e78c82de7
doc: benchmark: update with ‘laptop’ results after 1.5 release 2020-10-03 16:40:49 +02:00
Daniel Eklöf
71c54fb87c
csi: xtrestore: add ‘reverse wrap’ 2020-10-03 11:53:03 +02:00
Daniel Eklöf
97e07c1ea1
term: cursor-left: don’t do reverse-wrapping unless auto-margins are enabled
This matches XTerm’s behavior.
2020-10-03 10:50:28 +02:00
Daniel Eklöf
1ad766f4fb
changelog: reverse auto-wrap 2020-10-02 21:44:03 +02:00
Daniel Eklöf
377f1b7ad3
vt: BS: *only* reset lcf if cursor is beyond right margin: don’t move cursor
This is needed to make reverse auto-wrap work correctly. Without it,
we’ll end up moving the cursor left one cell extra.
2020-10-02 21:40:30 +02:00
Daniel Eklöf
03cacaba86
term: cursor-left: reverse-wrap when cursor is at the left margin
Assuming the private mode ‘reverse-wrap’ has been enabled.
2020-10-02 21:30:32 +02:00
Daniel Eklöf
060be30803
term: add private mode flag ‘’reverse-wrap’ 2020-10-02 21:29:56 +02:00
Daniel Eklöf
5594746e49
Revert "term: cursor-left: reduce move count by one when lcf=true"
This reverts commit 02e3e4ac9b.

This broke at least Emacs. Cursor movement at the margins *is*
undefined, and the behavior we’re now reverting to matches XTerm.
2020-10-02 20:02:36 +02:00
Daniel Eklöf
02e3e4ac9b
term: cursor-left: reduce move count by one when lcf=true
When lcf is true, cursor is actually beyond the right margin, but the
stored coordinate is at the margin.

This means we need to reduce the number of cells to move the cursor by
one.

This fixes an issue where e.g. backspacing when the cursor is at the
right margin erased the next-to-last character instead of the last
character.
2020-10-01 20:08:29 +02:00
Daniel Eklöf
1110108c84
changelog: trackpad scrolling: ‘multiplier’ is in the ‘scrollback’ section 2020-09-29 19:47:29 +02:00
Daniel Eklöf
5171abb188
Merge branch 'trackpad-scroll-speed' into master
Closes #144
2020-09-29 19:44:32 +02:00
Daniel Eklöf
9c84b08ae4
changelog: multiplier: the option belongs to the ‘scrollback’ section 2020-09-29 19:43:39 +02:00
Daniel Eklöf
2cee11d74d
changelog: multiplier default value changed from 1.0 -> 3.0 2020-09-29 19:42:50 +02:00
Daniel Eklöf
ebd1476baf
config: change default multiplier from 1.0 -> 3.0 2020-09-29 19:42:50 +02:00
Daniel Eklöf
08c1b35614
changelog: reword trackpad scrolling speed entry 2020-09-29 19:42:47 +02:00
Daniel Eklöf
a0ce7e40af
input: trackpad scroll: correctly convert pixel movements to line movements
Trackpad scroll movements are in pixels. Foot previously “translated”
these directly to line movements (i.e. a one pixel scroll event was
translated into a one line scroll).

Now we use the line height of the terminal and correctly convert
pixels to lines.

This makes the trackpad scroll speed in foot consistent with the
scroll speed in e.g. Alacritty and Kitty.
2020-09-29 19:42:31 +02:00
Daniel Eklöf
9015f37198
Merge branch 'reflow-retain-scrollback-position' into master
Closes #142
2020-09-29 19:40:38 +02:00
Daniel Eklöf
1718449ca6
grid: reflow: fix release build; ‘idx’ is only used in an assert() 2020-09-29 19:40:17 +02:00
Daniel Eklöf
8c18304287
grid: reflow: handle viewport being too far down when enlarging the window
If the viewport is close to the bottom, but not *at* the bottom, and
we’re enlarging the window, the translated viewport will be too far
down.
2020-09-29 19:40:17 +02:00
Daniel Eklöf
a0d1d2f1c8
grid: reflow: retain scrollback position
Closes #142
2020-09-29 19:40:14 +02:00
Daniel Eklöf
70f1274171
Merge branch 'osc4-refresh-scheduling' into master
Closes #141
2020-09-29 19:38:56 +02:00
Daniel Eklöf
002648d2a9
changelog: fixed color flashes with OSC 4,10,11 2020-09-29 10:11:03 +02:00
Daniel Eklöf
7ffd31e13a
render: remove render_refresh_margins() 2020-09-29 10:08:59 +02:00
Daniel Eklöf
edb904a187
osc: don’t explicitly call render_refresh() when changing the color palette
Doing so will schedule the renderer “as soon as possible”. I.e we’re
by-passing the regular scheduler, and thus we’re by-passing the user’s
setting of the delayed-render-* timers.

The fact that we’re scheduling “as soon as possible” also means we’re
much more likely to trigger flickering, or color flashes, if the
application is changing colors which are on the screen.

To handle changes to the cursor color(s), use the new
term_damage_cursor() instead of render_refresh().

To handle background color changes, which affect the margins, use the
new term_damage_margins() instead of render_refresh_margins(),

Closes #141
2020-09-29 10:05:52 +02:00
Daniel Eklöf
b19e07ad1c
render: term->render.margins is used to explicitly tell us to re-render margins 2020-09-29 10:04:41 +02:00
Daniel Eklöf
5116e40581
term: add term_damage_cursor() and term_damage_margins()
term_damage_cursor() damages the cell where the cursor is currently
at. This can be used to ensure the cursor is re-drawn, if there aren’t
any other pending updates.

term_damage_margins() requests the margins be redrawn the next time we
render the grid.
2020-09-29 10:04:18 +02:00
Daniel Eklöf
be9736dea3
Merge branch 'allow-mouse-binding-click-count-less-than' into master 2020-09-27 14:43:49 +02:00
Daniel Eklöf
6a089c92ca
input: mouse: match binding if binding’s click count is *less*
Allow a mouse binding to match even if its click count is less than
the actual click count.

If there are multiple bindings that match, use the one with the
highest click count (that less than, or equal to the actual click
count).

Closes #146
2020-09-27 14:31:39 +02:00