Commit graph

4055 commits

Author SHA1 Message Date
Daniel Eklöf
97bc740d3d
Merge branch 'underline-cursor-below-text-underline'
Closes #415
2021-04-10 11:10:51 +02:00
Daniel Eklöf
20849a4183
render: draw underline cursor below text underline
This ensures the cursor is visible on cells where the text is
underlined.

Closes #415
2021-04-09 21:47:57 +02:00
Daniel Eklöf
d84341827d
changelog: rewrite entry for OSC 17/117/19/119 2021-04-08 13:50:02 +02:00
Daniel Eklöf
5da65aadd4
Merge branch 'auto-left-margin-on-cub1-only'
Closes #441
2021-04-08 13:32:09 +02:00
Daniel Eklöf
131db418d8
changelog: auto_left_margin on cub1 only 2021-04-08 13:12:04 +02:00
Daniel Eklöf
5be2c53d8c
term/vt: only do reverse-wrapping (‘bw’) on cub1
Foot currently does reverse-wrapping (‘auto_left_margin’, or ’bw’) on
everything that calls ‘term_cursor_left()’. This is wrong; it should
only be done for cub1. From man terminfo:

    auto_left_margin | bw | bw | cub1 wraps from column 0 to last
    column

This patch moves the reverse-wrapping logic from term_cursor_left() to
the handling of BS (backspace).

Closes #441
2021-04-08 13:11:58 +02:00
Daniel Eklöf
0b3053f612
Merge branch 'osc-17-19' 2021-04-08 10:44:00 +02:00
Daniel Eklöf
55b343f690
osc: implement OSC 17+19: change selection background/foreground colors
And of course, we also implement the corresponding reset sequences,
OSC 117+119.
2021-04-08 10:43:36 +02:00
Daniel Eklöf
deb08ddba0
Merge branch 'osc-11-alpha'
Closes #436
2021-04-08 10:42:06 +02:00
Daniel Eklöf
28c2bea800
osc: reset background alpha when resetting the background color 2021-04-08 10:41:39 +02:00
Daniel Eklöf
0cabeee67e
doc: foot-ctlseq: mention that we support transparency in OSC 11 2021-04-08 10:41:39 +02:00
Daniel Eklöf
747e5ba287
changelog: don’t use a hyphen between ‘OSC’ and the number 2021-04-08 10:41:39 +02:00
Daniel Eklöf
339aad894b
changelog: tweak wording for URxvt’s XParseColor extension 2021-04-08 10:41:38 +02:00
Daniel Eklöf
8020c14637
osc: parse_legacy_color(): the alpha component is not a floating point number
When using the urxvt extension of the XParseColor format, the alpha
component is not a floating point number, but a decimal number in the
range 0-100.
2021-04-08 10:41:38 +02:00
Daniel Eklöf
5ff655506d
osc: parse_rgb(): ensure ‘alpha’ has been initialized 2021-04-08 10:41:38 +02:00
Daniel Eklöf
ed41bffc28
osc: add support for URxvt extension to include alpha in OSC-11
There are two variants, either using a ‘[percent]’ prefix for legacy
colors, or using ‘rgba:r/g/b/a’ instead of ‘rgb:r/g/b’.

Closes #436
2021-04-08 10:41:38 +02:00
Daniel Eklöf
0af7916fcc
Merge branch 'drain-pty-when-client-terminates' 2021-04-08 10:41:05 +02:00
Daniel Eklöf
47e532d4b0
ci: build on alpine/latest, not edge 2021-04-07 19:52:46 +02:00
Daniel Eklöf
fb4066f94e
terminal: drain PTY when client terminates
This is done by:

* Not limiting the number of times we try to read from the PTY when
  we’ve have POLLHUP
* Not requiring the entire the previous read to have filled our
  buffer.
* Not erroring out on EIO.
2021-04-07 19:09:31 +02:00
Daniel Eklöf
5f8a8951c7
sixel: unhook: tighten up the condition needed for us to free image data pre-maturely 2021-04-07 19:08:29 +02:00
Daniel Eklöf
f9a730f33b
sixel: sixel_fini(): free image data
Normally, this data is always free:d indirectly, when the sixel image
that took over ownership is destroyed. But let’s play it safe.
2021-04-07 19:07:43 +02:00
dnkl
b119a8a24a Merge pull request 'Don't copy default colors from config to each terminal instance' (#438) from refactor-colors into master
Reviewed-on: https://codeberg.org/dnkl/foot/pulls/438
2021-04-07 09:31:59 +02:00
Daniel Eklöf
936063271f
config/terminal: refactor: remove “default_*” color members from terminal struct
Access the original colors in the configuration instead.
2021-04-07 08:07:43 +02:00
Daniel Eklöf
44a166dde8
wayland: {xdg_,}output_*(): free old strings before assigning new ones
Defensive programming; output_geometry() etc are typically only called
once for an output instance. But let’s ensure we’re not leaking memory
if it’s called more than once.
2021-04-07 08:04:24 +02:00
Daniel Eklöf
e299b1d9f4
changelog: move OSC-4/104 fix from 1.7.1 to ‘unreleased’ 2021-04-05 22:07:58 +02:00
Daniel Eklöf
335bd36628
Merge branch 'osc-4-check-index-is-within-bounds'
Closes #434
2021-04-05 22:02:02 +02:00
Daniel Eklöf
4f0c0628a2
osc: verify OSC 4/104 color index is valid
Closes #434
2021-04-05 21:13:32 +02:00
Daniel Eklöf
4ec2c59861
Merge branch 'fix-error-message-for-key-binding-collisions'
Closes #432
2021-04-05 16:03:43 +02:00
Daniel Eklöf
65dead29e0
config: make {search,url}_binding_action_map[] function local
This ensures we don’t accidentally reference them from places we
shouldn’t.

Unfortunately, binding_action_map[] (for “normal” key bindings) cannot
easily be made function local since it is used when parsing both key-
and mouse bindings (i.e. it’s used in multiple functions).
2021-04-05 14:50:21 +02:00
Daniel Eklöf
fa6382aeb3
doc: foot.ini: fix default value for delete-next-word 2021-04-05 14:37:42 +02:00
Daniel Eklöf
285e3c4aa2
config: parse_key_binding_section(): use provided action-map
Don’t call has_key_binding_collisions() with ‘binding_action_map’
unconditionally; use the provided ‘action_map’ instead.

This fixes wrong error messages for key combo collisions in key
binding sections other than the regular “key-bindings”.
2021-04-05 14:36:22 +02:00
Daniel Eklöf
1b4b64dca7
Merge branch 'sixel-fix-double-free-in-set-palette-size'
Closes #427
2021-03-30 11:19:58 +02:00
Daniel Eklöf
00083125a1
sixel: fix double free caused by bad free() in sixel_colors_set()
sixel_color_set() is called when the number of (sixel) color registers
is changed.

It frees the current palette, and changes the “palette size” variable.

Originally, we only had a single palette. This is the one free:d by
sixel_color_set().

Later, we added support for private vs. shared palettes. With this
change, we now have one palette that is “never” free:d (the shared
one), and a private palette that is always free:d after a sixel has
been emitted.

‘sixel.palette’ is a pointer to the palette currently in use, and
should only be accessed **while emitting a sixel**.

This is the pointer sixel_color_set() free:d. So for example, if
‘sixel.palette’ pointed to the shared palette, we’d free the shared
palette. But, we didn’t reset ‘sixel.shared_palette’, causing a double
free later on.

Closes #427
2021-03-30 11:08:03 +02:00
Daniel Eklöf
515a139c28
Merge branch 'revert-remove-consumed-modifiers-from-set-sent-to-client'
Closes #425
2021-03-30 10:54:58 +02:00
Daniel Eklöf
058eba33ec
revert: input: do not include consumed modifiers in the set sent to the client
There were two issues with it:

* Not all applications decode the sequence into a set of modifiers +
  key, but use a fixed sequence -> combo mapping, that we broke.

* There were unforeseen issues with e.g. F1-12, where the modifier
  were removed from combos like Ctrl+F12, or Alt+F12. The reason is
  simple; XKB tells us that Ctrl, or Alt, is a consumed modifier. Now,
  _why_ it thinks that is a different story.

This reverts 6cd72bdee6

Closes #425
2021-03-29 20:11:32 +02:00
Daniel Eklöf
37245fe4e6
term: free vt.osc8.uri when destroying a terminal
Free vt.osc8.uri in term_destroy(), in the off chance, that the client
application emitted an un-terminated OSC-8 URI.
2021-03-28 21:01:22 +02:00
Daniel Eklöf
a88a86f797
install: add ‘ninja test’ to all build types
While we don’t (yet) have any unit tests for foot, users can build
foot with e.g. fcft and/or tllist as sub-projects. *They* have tests,
and when doing PGO builds, those test binaries *must* be executed, or
we get link failures in the final build.
2021-03-28 17:24:35 +02:00
Daniel Eklöf
5709630362
changelog: add new ‘unreleased’ section 2021-03-28 14:29:55 +02:00
Daniel Eklöf
5757b6dc1c
Merge branch 'releases/1.7' 2021-03-28 14:28:53 +02:00
Daniel Eklöf
ca89f977b5
meson/pkgbuild: bump version to 1.7.1 2021-03-28 14:25:29 +02:00
Daniel Eklöf
3c92777dd2
changelog: prepare for 1.7.1 2021-03-28 14:25:09 +02:00
Daniel Eklöf
0d0ebebb64
Merge branch 'master' into releases/1.7 2021-03-28 14:24:38 +02:00
Daniel Eklöf
6ae14614a5
Merge branch 'search-treat-empty-cells-as-spaces' 2021-03-28 14:22:34 +02:00
Daniel Eklöf
527d47488c
Merge branch 'sixel-trimming' 2021-03-28 13:46:10 +02:00
Daniel Eklöf
efbbcf289f
changelog: empty sixels resulted in non-empty images 2021-03-28 13:22:10 +02:00
Daniel Eklöf
19289bad5e
sixel: free backing buffer if final image size is zero 2021-03-28 13:22:10 +02:00
Daniel Eklöf
3566be591a
sixel: initialize max_non_empty_row_no to -1, not 0
0 is a perfectly valid row number, and if max_non_empty_row_no==0,
that means we have *1* sixel row, and after trimming the image, the
image will have a height of 6 pixels.

If the sixel sequence is empty (or at least doesn’t emit any non-empty
pixels), then trimming the image should result in an image height of
0.

When max_non_empty_row_no is initialized to -1, it will still have
that value in unhook(), which makes the final image height 0.
2021-03-28 13:22:09 +02:00
Daniel Eklöf
0a24d0e40f
changelog: spaces matches empty cells in scrollback search mode 2021-03-28 13:21:33 +02:00
Daniel Eklöf
2b7c5db188
search: when matching cell content, treat empty cells as spaces 2021-03-28 13:21:18 +02:00
Daniel Eklöf
a8c5168516
Merge branch 'pgo-clang-11'
Closes #418
2021-03-28 13:20:11 +02:00