Commit graph

779 commits

Author SHA1 Message Date
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
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
Daniel Eklöf
f91dc5dd00
changelog: prepare for 1.10.1 2021-11-22 21:56:38 +01:00
Daniel Eklöf
ad8d1bf25c
changelog: osc-8 data not being cleared when cell is overwritten 2021-11-21 18:09:37 +01:00
Daniel Eklöf
7522c2d211
changelog: pipe-* key bindings not being parsed correctly 2021-11-21 18:09:10 +01:00
Daniel Eklöf
9b232e07f9
config: create a copy of the section name
The parsing context keeps a pointer to the current section name. This
is used when logging errors.

However, the pointer was into a buffer allocated by getline(). This
buffer are often re-used in the next call to getline(), or free:d.

Regardless, the section name pointer is invalid after the next call to
getline(), which meant all error messages were logging a correct
section name.
2021-11-21 10:55:57 +01:00
Daniel Eklöf
b22322bfd1
config: letter-spacing: add missing ‘return’
The missing return caused us to fall through to the bottom of the
function, where we ended with an error message:

  [main].letter-spacing: 0: not a valid option: letter-spacing

Closes #795
2021-11-15 19:22:06 +01:00
Daniel Eklöf
843ba49565
footclient.desktop: new XDG desktop file, for footclient 2021-11-15 12:14:51 +01:00
Daniel Eklöf
31966f5494
meson: add -Dthemes=false|true
This adds a new meson option that controls whether the example theme
files should be installed or not. The default is true.

Previously, themes were gated by the -Ddocs option.
2021-11-14 23:12:18 +01:00
Daniel Eklöf
48758a101e
changelog: add new ‘unreleased’ section 2021-11-14 18:26:24 +01:00
Daniel Eklöf
d00d1b2514
changelog: prepare for 1.10.0 2021-11-14 18:10:43 +01:00
Daniel Eklöf
0686f94b18
config: remove options that were deprecated in 1.8.x
* [main].bell
* [main].jump-label-letters
* [main].url-launch
* [main].osc8-underline
2021-11-14 14:21:11 +01:00
Craig Barnes
26515b7ab9 changelog: fix minor grammatical mistake 2021-11-14 11:42:23 +00:00
Daniel Eklöf
c01904a2c7
config: add [colors].dim0-7
This allows you to configure custom colors to be used when colors are
being dimmed (`\E[2m`).

It is implemented by color matching (just like
bold-text-in-bright=palette-based); the color-to-be-dimmed is matched
against the current color palette.

If it matches one of the regular colors (colors 0-7), the
corresponding “dim” color will be used.

If it matches one of the bright colors (colors 8-15), the
corresponding “regular” color will be used (but *only* if the “dim”
color has been set).

Otherwise, the color is dimmed by reducing its luminance.

The default behavior, i.e. when dim0-7 hasn’t been configured, is to
dim by reducing luminance for *all* colors. I.e. we don’t do any color
matching at all. In particular, this means that dimming a bright color
will *not* result in the corresponding “regular” color.

Closes #776
2021-11-13 17:39:08 +01:00
Daniel Eklöf
4a74050999
input: add support for modifyOtherKeys=2
Similar to modifyOtherKeys=1 (foot’s default, and only, mode), except
that:

* All modifiers (and not just Ctrl) generate \E[27;m;n~ escapes
* Regular keys (with modifiers) also generate \E[27;m;n~ escapes (for
  example, C-h no longer generates ^H, but \E[27;5;104~)

For our keymap based lookups, this is handled by adding
MOD_MODIFY_OTHER_KEYS_STATE<N> variants.

For “generic” keys, we simply adjust the conditions for when to emit a
\E[27;m;n~ escape - the only requirement is that at least one modifier
is active.
2021-11-13 11:09:07 +01:00
Daniel Eklöf
ebcf5a4b4f
input: don’t apply [scrollback].multiplier when alt screen is in use
Closes #787
2021-11-13 11:05:36 +01:00
Daniel Eklöf
b5f7c414a9
changelog: boolean options 2021-11-13 11:04:30 +01:00
Daniel Eklöf
a08f4bc551
PKGBUILD: drop
The bundled PKGBUILD has been pretty much identical to the one in the
AUR package “foot-git” for a long time now.
2021-11-07 15:58:42 +01:00
Daniel Eklöf
0183e13f50
wayland: error out if there aren’t any seats available
If there aren’t any seats available, input is not possible (neither
keyboard nor mouse input).

Note that this is not the same thing as e.g. no keyboard being plugged
in. In this case, there will be a seat, but without the keybaord
capability. Input may not be possible _right now_, but may be later,
if the user plugs in a keyboard.

Closes #779
2021-11-07 11:29:25 +01:00
Daniel Eklöf
5e4de143de
csd: add support for a visible border
When we’re using CSDs, we’ve up until now rendered a 5px invisible
border. This border handles interactive resizing. I.e. hovering it
changes the mouse cursor, and mouse button events are used to start an
interactive resize.

This patch makes it possible to color part of (or the entire) border,
with a configurable color.

To facilitate this, two new options have been added:

* csd.border-width
* csd.border-color

border-width defaults to 0, resulting in the look we’re used to.

border-color defaults to the title bar color. If the title bar color
hasn’t been set, it defaults to the default foreground color (just
like the title bar color does).

This means that, setting border-width but not border-color, results in
a border that blends with the title bar.
2021-10-27 18:32:28 +02:00
Daniel Eklöf
eebec8e38d
meson: install themes to $datadir/foot/themes 2021-10-27 17:31:02 +02:00
Daniel Eklöf
bcea929c94
config: add [key-bindings].noop action
Key combinations assigned to this action will not be sent to the
application.

Closes #765
2021-10-27 17:07:26 +02:00
Daniel Eklöf
3b57cd45a4
changeloge: style fixes 2021-10-22 19:57:11 +02:00
Daniel Eklöf
2fbc336eb9
term: ignore window title updates if title is un-changed 2021-10-22 18:01:53 +02:00
Daniel Eklöf
8691ad8b2e
input: update serial on each key press/release and mouse button
The serial is used when copying/pasting data from the clipboard. Up
until now, we’ve used the serial from the keyboard/mouse enter
events.

This works in most cases, but breaks in the following example:

  $ wl-copy  WLCOPY
  /* Ctrl+Shift+v works fine (pastes "WLCOPY") */

  $ printf "\033]52;c;eHl6\a"
  /* Ctrl+Shift+v pastes "WLCOPY" instead of "xyz" */

Shifting focus away and then back to the foot window, and re-executing
the printf works, suggesting the “enter” serial is no longer valid
after another process(?) has copied something to the clipboard.

Updating the serial on key press/release (and the corresponding mouse
serial on mouse button events) seems to fix this.

I’ve also tested that “normal” copy/paste operations, within the same
foot instance, and between foot and other applications, are still
working. In at least river (wlroots based), and GNOME/mutter.

Closes #753
2021-10-20 19:59:57 +02:00
Daniel Eklöf
5ab49de7f2
selection: convert \r -> \n when reading clipboard data
This fixes an issue where pasting (using e.g. OSC-52) in client
applications that doesn’t do this conversion themselves, like tmux,
doesn’t work.

Closes #752
2021-10-19 21:34:04 +02:00
Daniel Eklöf
d4b365b55c
pgo: full-inner: add --override tweak.grapheme-shaping=no
Grapheme shaping is now enabled by default in foot. However, when
generating the profiling data in PGO builds, this results in skewed
optimizations.

The end result is worse benchmark results regardless of whether
grapheme-shaping is enabled or not (when running the benchmarks).
2021-10-16 16:58:59 +02:00
Daniel Eklöf
37f9f54840
config: enable grapheme shaping by default
This changes the default value of tweak.grapheme-shaping to “yes”,
thus enabling grapheme shaping by default.

It also changes the default value of tweak.grapheme-width-method to
“wcswidth”, for maximum compatibility with terminal applications.
2021-10-13 17:42:40 +02:00
feeptr@codeberg.org
85cc05ba22 changelog: list scrollback.indicator-color addition 2021-10-09 16:59:52 -04:00
Daniel Eklöf
0be711497d
Merge branch 'fix-0px-csd-crash' 2021-10-08 10:05:52 +02:00
feeptr@codeberg.org
ed42276ee1 changelog: mention csd.size=0 fix 2021-10-08 02:28:01 +00:00