Commit graph

808 commits

Author SHA1 Message Date
Daniel Eklöf
0ccdb27520
changelog: fixed failing to launch when exec(3):ed with an empty argv 2022-01-01 21:17:36 +01:00
Autumn Lamonte
d72ba4a062
SGR-Pixels mouse mode, closes #762 2022-01-01 11:02:30 +01:00
Daniel Eklöf
abec4f4e71
render: csd: scale border width when rendering the CSD border’s visible part 2021-12-29 18:11:51 +01:00
Daniel Eklöf
ef8d5ebca0
render: scale the width out the outline of the unfocused block cursor 2021-12-28 20:57:24 +01:00
Daniel Eklöf
c9086e6d4f
input: apply scrollback.multplier in alterate scroll mode
Before this patch, foot only applied [scrollback].multiplier on the
normal screen, never the alt screen.

However, scrolling can be done in two ways on the alt screen:

If the application has enabled mouse support, we simply pass on the
mouse scroll events to the application. Here, it makes sense to not
apply the multiplier, and instead let the application choose how much
to scroll for each scroll event.

But, if the application has not enabled mouse support, we can still
scroll by simulating the arrow keys being pressed - alternate
scrolling (private mode 1007).

This is enabled by default in foot (but can be disabled in foot.ini
with the [mouse].alternate-scroll-mode setting).

In this mode, it makes more sense to apply the multiplier. And that’s
what this patch changes - the multiplier is now applied, on the alt
screen, when the application has not enabled mouse support, and
alternate scrolling has been enabled in foot.

Closes #859
2021-12-28 17:10:03 +01:00
Daniel Eklöf
1217cb50d2
changelog: irc+ircs added to default value of url.protocols 2021-12-27 21:13:26 +01:00
Daniel Eklöf
3f10ee87b1
term: print: erase existing OSC-8 URI
If we have an “active” OSC-8 URI, term_print() would correctly replace
an existing URI with the new one.

But, if we don’t have an active URI, an existing URI was not
erased. This can be reproduced with e.g

  echo -e '\e]8;;http://foo.bar\e\\foobar\e]8;;\e\\\b\b\b\b\b😀\n'
2021-12-26 14:51:26 +01:00
Daniel Eklöf
a93e7867ff
changelog: grammar 2021-12-23 14:09:48 +01:00
Daniel Eklöf
41f7f8b7fa
render: make sure ‘maximized’ button doesn’t use negative coordinates 2021-12-22 20:31:38 +01:00
Daniel Eklöf
c076f03dc4
config: error out on empty key- or mouse binding
Closes #851
2021-12-18 20:39:08 +01:00
Daniel Eklöf
fc6533c920
shm: get_buffer(): make sure buffer->busy is set
When going through the cached buffers, we only set buffer->busy on
the *first* re-usable buffer we found.

In some cases, we will find more than one re-usable buffer. In this
case, we select the “youngest” one (i.e the one most recently used, in
the hopes that we can use damage tracking instead of re-rendering the
entire buffer).

If the “current” buffer is younger than the previously detected,
re-usable, buffer, then we unref:ed the previously selected buffer,
and replaced it with the current one.

But, we did not sanitize it. That is, we did not:

* set buffer->busy
* clear its dirty region
* clear its scroll damage

That buffer would eventually get rendered to, and committed to the
compositor. Later, the compositor would free it. And there, in our
buffer_release() callback, we’d assert that buffer->busy was
set. And fail.

Closes #844
2021-12-18 14:26:26 +01:00
Daniel Eklöf
828e894e96
themes: consistently use snake-case in theme names 2021-12-18 14:24:30 +01:00
Daniel Eklöf
4c5f53878e
input: kitty: don’t fallback to the XKB symbol
When handling “generic” keys (i.e. keys not in the Kitty keymap), we
use the pressed key’s Unicode codepoint as “key” in the kitty CSI.

If we failed to convert the XKB symbol to a Unicode codepoint, we used
to (before this patch), fallback to using the XKB symbol as is.

This can never be correct... and it caused us to emit a meaningless
CSI for XKB_KEY_ISO_Next_Group, which confused e.g. Kakoune.
2021-12-16 12:49:41 +01:00
Daniel Eklöf
a098fad004
term: font_size_adjust: use DPI=96 when font is *not* scaled by DPI
Closes #842
2021-12-14 17:45:12 +01:00
Daniel Eklöf
c685406a13
changelog: kitty kbd: add link to codeberg issue 2021-12-08 19:06:51 +01:00
Daniel Eklöf
7ed671ef59
Merge branch 'releases/1.10' 2021-12-08 18:20:53 +01:00
Daniel Eklöf
baae46ea75
changelog: kitty: alternate keys: base layout key is implemented 2021-12-08 18:20:26 +01:00
Daniel Eklöf
3d7643b181
Merge branch 'releases/1.10' 2021-12-08 18:14:44 +01:00
Daniel Eklöf
924726ac76
changelog: prepare for 1.10.3 2021-12-08 18:08:45 +01:00
Daniel Eklöf
010c4001d2
kitty: initial support for “report alternate key”
In this mode, the “shifted” and “base layout” keys are added to the
CSIs, as sub-parameters to the “key” parameter.

Note that this PR only implements the “shifted” key, not the “base
layout key”.

This is done by converting the original XKB symbol to it’s
corresponding UTF-32 codepoint. If this codepoint is different from
the one we use as “key” in the CSI, we add it as a sub-parameter.

Related to #319
2021-12-08 18:06:02 +01:00
Daniel Eklöf
7a5386d883
kitty: implement “report associated text”
In this mode, key events that generate text now add a third CSI
parameter, indicating the actual codepoint.

Remember that we always use the *unshifted* key in the CSI
escapes. With this mode, those CSI escapes now also included the text
codepoint. I.e. what would have been emitted, had we not generated a
CSI escape.

As far as I can tell, this mode has no effect unless “report all keys
as escape sequences” is enabled (reason being, without that, there
aren’t any text events that generate CSIs - they’re always emitted
as-is).

Note that Kitty itself seems to be somewhat buggy in this mode. At
least on Wayland, with my Swedish layout. For example ‘a’ and ‘A’ does
generate the expected CSIs, but ‘å’ and ‘Å’ appears to be treated as
non-text input.

Furthermore, Kitty optimizes away the modifier parameter, if no
modifiers are pressed (e.g. CSI 97;;97u), while we always emit the
modifier (CSI 97;1;97u).

Related to #319
2021-12-08 18:05:46 +01:00
Daniel Eklöf
9649842eca
grid: reload pointers into the uri range vector after inserting
Inserting elements into the URI range vector typically triggers a
vector resize. This is done using realloc(). Sometimes this causes the
vector to move, thus invalidating all existing pointers into the
vector.
2021-12-08 18:05:40 +01:00
Daniel Eklöf
4e34fb8fb7
input: kitty: add support for “report all keys as escape codes” 2021-12-08 18:05:33 +01:00
Daniel Eklöf
8b260568fb
term: ensure cell dimensions are non-zero
Closes #830
2021-12-08 18:05:20 +01:00
Daniel Eklöf
46cd5dfafc
changelog: move entry to ‘unreleased’ 2021-12-08 18:05:04 +01:00
Daniel Eklöf
a242ba3f97
changelog: kitty: report events 2021-12-08 18:03:44 +01:00
Daniel Eklöf
1a5a0952d5
changelog: add new ‘unreleased’ section 2021-12-08 18:02:57 +01:00
Daniel Eklöf
9d5ab91b6a
kitty: initial support for “report alternate key”
In this mode, the “shifted” and “base layout” keys are added to the
CSIs, as sub-parameters to the “key” parameter.

Note that this PR only implements the “shifted” key, not the “base
layout key”.

This is done by converting the original XKB symbol to it’s
corresponding UTF-32 codepoint. If this codepoint is different from
the one we use as “key” in the CSI, we add it as a sub-parameter.

Related to #319
2021-12-08 17:54:37 +01:00
Daniel Eklöf
78666d248a
kitty: implement “report associated text”
In this mode, key events that generate text now add a third CSI
parameter, indicating the actual codepoint.

Remember that we always use the *unshifted* key in the CSI
escapes. With this mode, those CSI escapes now also included the text
codepoint. I.e. what would have been emitted, had we not generated a
CSI escape.

As far as I can tell, this mode has no effect unless “report all keys
as escape sequences” is enabled (reason being, without that, there
aren’t any text events that generate CSIs - they’re always emitted
as-is).

Note that Kitty itself seems to be somewhat buggy in this mode. At
least on Wayland, with my Swedish layout. For example ‘a’ and ‘A’ does
generate the expected CSIs, but ‘å’ and ‘Å’ appears to be treated as
non-text input.

Furthermore, Kitty optimizes away the modifier parameter, if no
modifiers are pressed (e.g. CSI 97;;97u), while we always emit the
modifier (CSI 97;1;97u).

Related to #319
2021-12-08 17:53:00 +01:00
Daniel Eklöf
2e8c9c2fe5
grid: reload pointers into the uri range vector after inserting
Inserting elements into the URI range vector typically triggers a
vector resize. This is done using realloc(). Sometimes this causes the
vector to move, thus invalidating all existing pointers into the
vector.
2021-12-08 17:41:29 +01:00
Daniel Eklöf
0e2d8429c0
input: kitty: add support for “report all keys as escape codes” 2021-12-06 19:49:52 +01:00
Daniel Eklöf
73baa4cf5f
Merge branch 'ensure-cell-dimensions-are-non-zero'
Closes #830
2021-12-06 19:47:32 +01:00
Daniel Eklöf
06c72fc8c3
term: ensure cell dimensions are non-zero
Closes #830
2021-12-04 18:41:36 +01:00
Daniel Eklöf
20c887b996
changelog: move entry to ‘unreleased’ 2021-12-04 18:32:18 +01:00
Daniel Eklöf
4e5d1b5c79
changelog: kitty: report events 2021-12-04 18:32:06 +01:00
feeptr@codeberg.org
b52cd67467 config, doc, changelog: move selection-override-modifiers to [mouse-bindings] and validate other case
specifically, check for conflicts both when mouse bindings are set and when the selection-override-modifiers setting itself is set
2021-12-02 18:47:41 -05:00
feeptr@codeberg.org
300acda813 changelog: list new mouse.selection-override-modifiers option 2021-12-02 23:47:04 +00:00
Daniel Eklöf
281127cae1
changelog: add new ‘unreleased’ section 2021-12-02 20:36:09 +01:00
Daniel Eklöf
5a59bbdb71
changelog: prepare for 1.10.2 2021-12-02 20:26:42 +01:00
Daniel Eklöf
a3016a6cc9
osc-4: don’t update the color of cells with RGB fg/bg colors
OSC 4/104 changes the 256-color palette. We also run a pass over the
visible cells, and update their colors.

This was previously done by comparing the actual color of the cell,
with the “old” color in the palette. If they matched, the cell was
updated.

This meant that cells with an RGB color (i.e. not a palette based
color) was also updated, _if_ its color matched the palette color.

Now that each cell tracks its color *source*, we can ignore all
non-palette based cells.

Note that this still isn’t perfect: if the palette contains multiple
entries with the same color, we’ll end up updating the “wrong” cells.

Closes #678
2021-12-01 20:07:53 +01:00
Daniel Eklöf
1619e83c13
input: always update the xcursor shape in pointer enter/motion events
Now that term_xcursor_update_for_seat() takes the current surface into
account (i.e. doesn’t assume the cursor is over the main grid),
there’s no longer any need to call render_xcursor_set() directly.

Thus, we can simply call term_xcursor_update_for_seat() on **all**
pointer enter and motion events. As long as we take care to update the
internal state to reflect the, possibly new, current surface before
doing so.

Also make sure to **always** reset the seat’s “current” xcursor
pointer on pointer leave events. This is done without actually sending
anything to the compositor, but is necessary to ensure that we *do*
send a request to update the xcursor on the next pointer enter event.
2021-12-01 20:04:01 +01:00
Daniel Eklöf
fd82fb81fa
changelog: window-menu 2021-11-30 22:12:17 +01:00
Daniel Eklöf
3afe317e46
render: fix csd border rendering glitch when width > 5px
CSD borders are always *at least* 5px. If url.border-width=0, those
5px are all fully transparent (and act as interactive resize handles).

As csd.border-width increases, the number of transparent pixels
decrease. Once csd.border-width >= 5, the border is fully opaque.

When csd.border-width > 5, then width of the border is (obviously)
more than 5px. But, when rendering the opaque part of the border, we
still used 5px for the invisible part, which caused some pixman
rectangles to have negative x/y coordinates.

This resulted in rendering glitches due to overflows in pixman when
rendering the borders.

The fix is to ensure the total border size is always at least, but
not *always* 5px. That is, set it to max(5, csd.border-width).

This patch also fixes an issue where the CSD borders were not
dimmed (like the titlebar) when the window looses input focus.

Closes #823
2021-11-29 19:32:49 +01:00
Daniel Eklöf
1f19dd6694
changelog: kitty keyboard protocol - disambiguate escape codes 2021-11-28 15:14:56 +01:00
Daniel Eklöf
be203aeae1
grid: bug: OSC-8 URIs were incorrectly skipped while resizing the alt screen 2021-11-26 20:29:23 +01:00
Daniel Eklöf
8c50a7afd4
osc8: update URI ranges as we print data, *not* when the URI is closed
At first, an OSC-8 URI range was added when we received the closing
OSC-8 escape (i.e. with an empty URI).

But, this meant that cursor movements while the OSC-8 escape was in
effect wasn’t handled correctly, since we’d add a range that spanned
the cursor movements.

Attempts were made to handle this in the cursor movement functions, by
closing and re-opening the URI.

However, there are too many corner cases to make this a viable
approach. Scrolling is one such example, line-wrapping another.

This patch takes a different approach; emit, or update the URI range
when we print to the grid. This models the intended behavior much more
closely, where an active OSC-8 URI act like any other SGR attribute -
it is applied to all cells printed to, but otherwise have no effect.

To avoid killing performance, this is only done in the “generic”
printer. This means OSC-8 open/close calls must now “switch” the ASCII
printer.

Note that the “fast” printer still needs to *erase* pre-existing OSC-8
URIs.

Closes #816
2021-11-25 19:31:03 +01:00
Daniel Eklöf
325ad6dd4e
input: finalize mouse selection on a pointer-leave event on the GRID surface
If a mouse selection was ongoing, and the user switched
workspace (probably using the keyboard...), and then back, the
selection was still treated as ongoing, while all other mouse state
has been reset.

This meant the user had to tap at least once to stop the selection.
2021-11-25 15:21:53 +01:00
Daniel Eklöf
c1c0f11821
config: add tweak.grapheme-width-method=max
‘max’ is a new value for ‘tweak.grapheme-width-method’. When enabled,
the width of a grapheme cluster is that of the cluster’s widest
codepoint.
2021-11-23 19:50:05 +01:00
Daniel Eklöf
caec64cbda
changelog: add new ‘unreleased’ section 2021-11-22 22:24:13 +01:00
Daniel Eklöf
8b979e9dba
changelog: add #801 to “OSC-8 data not being cleared...” 2021-11-22 22:23:28 +01:00