Commit graph

6097 commits

Author SHA1 Message Date
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
Daniel Eklöf
1685f38ee6
changelog: custom modifiers in key bindings 2024-02-06 11:10:36 +01:00
Daniel Eklöf
0aefc2c65d
input: remove the concept of "significant" modifiers
For the purpose of matching key bindings, "significant" modifiers are
no more.

We're really only interested in filtering out "locked"
modifiers. We're already doing this, so there's no need to *also*
match against a set of "significant" modifiers.

Furthermore, we *never* want to consider locked keys (e.g. when
emitting escapes to the client application), thus we can filter those
out already when retrieving the set of active modifiers.

The exception is the kitty keyboard protocol, which has support for
CapsLock and NumLock. Since we're already re-retrieving the "consumed"
modifiers (using the GTK style, rather than normal "XKB" style, to
better match the kitty terminal), we might as well re-retrieve the
effective modifiers as well.
2024-02-06 11:08:42 +01:00
Daniel Eklöf
4730ff8d08
input/config: support *all* modifier names
That is, allow custom modifiers (i.e. other than ctrl/shift/alt etc)
in key bindings.

This is done by no longer validating/translating modifier names to
booleans for a pre-configured set of modifiers (ctrl, shift, alt,
super).

Instead, we keep the modifier *names* in a list, in the key binding
struct.

When a keymap is loaded, and we "convert" the key binding, _then_ we
do modifier translation. For invalid modifier names, we print an
error, and then ignore it. I.e. we no longer fail to load a config due
to invalid modifier names.

We also need to update how we determine the set of significant
modifiers. Any modifier not in this list will be ignored when matching
key bindings.

Before this patch, we hardcoded this to shift/alt/ctrl/super. Now, to
handle custom modifiers as well, we simply treat *all* modifiers
defined by the current layout as significant.

Typically, the only unwanted modifiers are "locked" modifiers. We are
already filtering these out.
2024-02-06 11:05:20 +01:00
Andrew J. Hesford
21a8d832ce
feature: add resize-by-cells option to constrain window sizes...
...to multiples of the cell size, and preserve grid size when changing
fonts or display scales in floating windows.
2024-02-05 12:14:53 +01:00
Craig Barnes
e0f3703ae6
util: add streq() function and use in place of strcmp(...) == 0 2024-02-05 12:09:52 +01:00
Craig Barnes
44c0cf594b
csi: simplify handling of Set/Reset Mode (SM/RM) sequences 2024-01-27 08:43:32 +01:00
Craig Barnes
91b22ae21a Replace unchecked allocations with calls to xmalloc.h functions 2024-01-25 07:03:50 +00:00
Daniel Eklöf
43e27a8843
wayland: 'mode' is unused when LOG_ENABLE_DBG is not set 2024-01-24 20:00:18 +01:00