Commit graph

6105 commits

Author SHA1 Message Date
Daniel Eklöf
702d3ae6ca
kitty kbd: update handling of locked modifiers
The kitty keyboard specification has been updated/clarified yet
again. Locked modifiers are to be ignored if the key event would
result in plain text without the locked modifier being enabled.

In short, locked modifiers are included in the set of modifiers
reported in a key event. But having a locked modifier enabled doesn't
turn all key events into CSIu sequences.

For example, with only the disambiguate mode enabled, pressing 'a', or
'shift+a' results in a/A regardless of the state of Caps- or NumLock.

But 'ctrl+a', which always results in a CSIu, will have a different
modifier list, depending on whether Caps- or NumLock are enabled.
2024-03-06 16:33:24 +01:00
Daniel Eklöf
ec73e4d10d
kitty kbd: switch from GTK to XKB mode for 'consumed' modifiers
This fixes an issue where some key combinations resulted in different
output (e.g. escape code vs. plain text) depending on the state of
e.g. the NumLock key. One such example is Shift+space. Another example
is Shift+BackSpace.

This patch also removes the hardcoded CapsLock filter, when
determining whether a key combo produces text or not, and instead uses
the locked modifiers as reported by XKB.
2024-03-02 10:28:25 +01:00
Daniel Eklöf
d3b348a5b1
cursor-shape: improve xcursor fallback support, and prefer CSS names
Before this patch, we used legacy X11 xcursor names, and didn't really
have any fallback handling in place (we only tried to fallback to
"xterm", regardless of which cursor shape we were trying to load).

This patch changes two things:

1. Improved fallback support. cursor_shape_to_string() now returns a
   list of strings. This allows us to have per-shape fallbacks, and any
   number of fallbacks.

2. We prefer CSS xcursor names over legacy X11 names.
2024-03-01 07:04:48 +01:00
Daniel Eklöf
6fd533ce13
render: don't try to set a NULL xcursor image
render_xcursor_update() is called when we've loaded a new xcursor
image, and needs to display it. The reason it's not pushed to the
compositor immediately is to ensure we don't flood the Wayland socket
with xcursor updates.

Normally, it's only called when we *succeed* to load a new xcursor
image. I.e. if we try to load a non-existing xcursor image, we never
schedule an update.

However, we _can_ still end up in render_xcursor_update() without a
valid xcursor image. For example, we have loaded a valid xcursor
image, and scheduled an update. But before the update runs, the user
moves the cursor, and we try to load a new xcursor image. If it fails,
we crash when the previously scheduled update finally runs.

Closes #1624
2024-02-29 08:16:20 +01:00
Daniel Eklöf
4bb3b5383f
ci: run x86+x64 builds in parallel
... by making them depend on the 'subprojects' step.
2024-02-24 10:05:05 +01:00
Daniel Eklöf
3d9aa1c29c
config: don't try to free key combos we haven't allocated
When erroring out due to a key combo being "empty", we incorrectly
tried to free one key binding. This is because 'used_combos' is
initialized to '1'. And it should, but an empty key binding is a
special case.

Fixes a test failure, and closes #1620
2024-02-24 09:58:04 +01:00
Daniel Eklöf
a5ab490380
ci: remove deprecated 'group' 2024-02-24 09:54:51 +01:00
Daniel Eklöf
1c985537ec
ci: 'steps' is a list 2024-02-23 18:02:18 +01:00
Daniel Eklöf
0dc105d0e4
ci: rename .woodpecker.yml -> .woodpecker.yaml
According to the latest woodpecker docs, this is the only supported
extension.
2024-02-23 17:59:01 +01:00
Daniel Eklöf
678bdb7c3f
config: on error, correctly free partially parsed key combos 2024-02-23 17:49:24 +01:00
Daniel Eklöf
d31ccf12d0
changelog: kitty modifier no longer clears selection + viewport 2024-02-23 17:48:01 +01:00
Tim Culverhouse
749d36d321 input: don't clear text selection on modifier keypresses
When kitty keyboard is enabled, pressing a modifier key will clear the
text selection. This makes it difficult to copy text because the
selection clears as soon as the user presses "ctrl".

Tested-by: Robin Jarry <robin@jarry.cc>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-02-22 15:23:40 -06:00
Daniel Eklöf
67f97cbca1
shm: use XRGB surfaces when we know we wont be using transparency 2024-02-21 16:29:10 +01:00
Daniel Eklöf
09d856f2ff
input: improved debug logging of key press/release
* Log which it is: press or release
* Include locked modifiers
* Include human-readable names of the modifiers
2024-02-20 16:18:55 +01:00
Daniel Eklöf
0c94bf43f2
vt: ignore VS16 (U+FE0F) when grapheme clustering is disabled
This fixes:

a) a compilation error with -Dgrapheme-clustering=disabled

b) ensures U+FE0F does *not* allocate a two cells when grapheme
   clustering has been disabled (either compile time, in config, or
   run-time).
2024-02-16 07:13:32 +01:00
Daniel Eklöf
aca9af0202
vt: VS16 - variation selector 16 (emoji representation) should only affect emojis 2024-02-15 16:56:30 +01:00
Daniel Eklöf
9ca84e6b48
config: map Control+wheel to font increase/decrease
This is in addition to the already existing keyboard shortcuts.

Also add missing default keyboard/mouse bindings to readme + foot(1).
2024-02-15 16:55:40 +01:00
Daniel Eklöf
729bd57cae
term: erase-scrollback: handle non-existing scrollback history
If scrollback.lines == 0, and the window size (number of rows) is a
power of two, all rows are always visible. I.e. there is no scrollback
history.

This threw off the scrollback erase logic, causing visible rows to be
erased, and set to NULL. This triggered a crash when trying to update
the view.

Closes #1610
2024-02-15 16:54:41 +01:00
Daniel Eklöf
c114afadbd
render: always center grid when fullscreened or maximized 2024-02-15 16:54:01 +01:00
Craig Barnes
fa01bf2b75 csi: support DECRQM queries for ECMA-48 (SM/RM) modes
This is in addition to the existing support for DECRQM queries
of DEC private modes.
2024-02-11 15:09:28 +00:00
Daniel Eklöf
9d9690410a
pgo: render_resize_force() has been removed, adjust stub accordingly
Closes #1601
2024-02-08 16:44:55 +01:00
Daniel Eklöf
69df42c51b
doc: better examples for pipe-* commands 2024-02-07 17:09:01 +01:00
Daniel Eklöf
bc8c2e0112
wayland: regression: use correct scaling factor when calling render_resize()
When an output property (such as scaling factor) has changed, we need
to call render_resize() to ensure the window surface is correct (for
example, we may have to change its scale).

The width/height parameters are in *logical* pixels (i.e. already
scaled). For render_resize() to work correctly when the scale is being
changed, it needs to be called with *current* logical size. This means
we need to scale our current width/height using the *old* scaling
factor.
2024-02-07 16:22:33 +01:00
Daniel Eklöf
ebbee61f14
input: remove debug logging 2024-02-06 14:04:59 +01:00
Daniel Eklöf
3b5d83a3ec
pgo: add missing stub for render_refresh_app_id() 2024-02-06 14:04:22 +01:00
Daniel Eklöf
af114f81a0
pgo: fix function prototype for stub function get_current_modifiers() 2024-02-06 14:03:07 +01:00
Daniel Eklöf
4b075bb075
osc: 176 (app-id): implement query+reply
Applications can now query for the current app-id with:

    \E] 176 ; ? \E\\

The reply is

    \E] 176 ; <title> \E\\
2024-02-06 13:55:30 +01:00
Daniel Eklöf
0b95e72073
Merge branch 'app-id' 2024-02-06 13:50:38 +01:00
Daniel Eklöf
22f04f6a84
changelog: OSC-176 - set app-id 2024-02-06 13:50:19 +01:00
delthas
6c56b04b3f
osc: add support for osc 176 (app ID)
This adds support for a new OSC escape sequence: OSC 176, that lets
terminal programs tell the terminal the name of the app that is
running. foot then sets the app ID of the toplevel to that ID,
which lets the compositor know which app is running, and typically
sets the appropriate icon, window grouping, ...

See: https://gist.github.com/delthas/d451e2cc1573bb2364839849c7117239
2024-02-06 13:50:09 +01:00
Daniel Eklöf
4801d3a305
term: drop term->render.title.is_armed
This boolean isn't needed. The idea was probably to not re-program the
timer unnecessarily, or even to prevent it from being moved forward in
time indefinitely.

However, the logic has (probably) gone through some changes, that now
makes it irrelevant.

The timer isn't moved forward indefinitely; it is always set to 8ms
from the last title update. The closer we get to that point in time,
the smaller the timeout we set.

Now, is_armed _did_ prevent the timer from being re-programmed. But
that tiny performance tweak isn't really necessary, as the title
should, in normal cases, not be set that often anyway.
2024-02-06 13:41:09 +01:00
Daniel Eklöf
41dc259744
doc: foot-ctlseq: add OSC 133 C/D (command output start/end) 2024-02-06 13:38:08 +01:00
Daniel Eklöf
316136f428
term: ignore attempts to set a title that contains an invalid UTF-8 sequence
Setting the title ultimately leads to a call to
xdg_toplevel::set_title(). It is a protocol violation to try to set a
title that contains an invalid UTF-8 sequence:

    The string must be encoded in UTF-8.

Closes #1552
2024-02-06 13:10:35 +01:00
Daniel Eklöf
756da87346
changelog: smm+rmm 2024-02-06 12:38:31 +01:00
Daniel Eklöf
9f4eb13e9e
terminfo: smm: enable 8-bit Meta mode
To enable 8-bit meta mode, we need to:

* disable "send ESC when meta modifies a key" (private mode 1036)
* enable "8-bit meta mode" (private mode 1034)

rmm reverses the above.

Closes #1584
2024-02-06 12:38:19 +01:00
Daniel Eklöf
7999975016
Don't use fancy Unicode quotes, stick to ASCII 2024-02-06 12:36:45 +01:00
Daniel Eklöf
d6939dd634
readme: shell integration: fix wiki link 2024-02-06 12:26:00 +01:00
Daniel Eklöf
84e681f028
readme: add "Piping last command's output" to index 2024-02-06 12:14:48 +01:00
Daniel Eklöf
0a302265ec
Merge branch 'pipe-command-output' 2024-02-06 12:13:27 +01:00
Daniel Eklöf
231e6eb3f1
grid: resize with reflow: reflow FTCS_COMMAND_{EXECUTED,FINISHED} 2024-02-06 12:13:09 +01:00
Daniel Eklöf
110a6dd6f0
grid: resize without reflow: truncate shell_integration.cmd_{start,end}
This ensures the cmd start/end columns are valid in the new grid.
2024-02-06 12:13:09 +01:00
Daniel Eklöf
d5308a0493
term: command_output_to_text(): don’t skip FTCS_COMMAND_FINISHED on last row 2024-02-06 12:13:09 +01:00
Daniel Eklöf
1393942de3
readme, doc/foot.1: document shell-integration:command-output tracking 2024-02-06 12:13:09 +01:00
Daniel Eklöf
d7dbb91e65
changelog: pipe-command-output 2024-02-06 12:13:08 +01:00
Daniel Eklöf
0fed2451ea
doc: foot.ini: document pipe-command-output 2024-02-06 12:12:57 +01:00
Daniel Eklöf
f2a8368759
foot.ini: add pipe-command-output key binding 2024-02-06 12:12:57 +01:00
Daniel Eklöf
1c70a84fde
config: add pipe-command-output key-binding 2024-02-06 12:12:57 +01:00
Daniel Eklöf
e9607de5ae
osc: store column of FTCS_COMMAND_{EXECUTED,FINISHED} in row struct 2024-02-06 12:12:57 +01:00
Daniel Eklöf
f8e875a7cd
term: move row->prompt_marker into new struct, row->shell_integration 2024-02-06 12:12:56 +01:00
Daniel Eklöf
0f10c4fd6c
Merge branch 'modifiers'
Closes #1348
2024-02-06 12:11:51 +01:00