Commit graph

4057 commits

Author SHA1 Message Date
Daniel Eklöf
0d4e61bbe8
meson/pkgbuild: bump version to 1.7.2 2021-04-18 20:12:40 +02:00
Daniel Eklöf
7e2e9d4de8
changelog: prepare for 1.7.2 2021-04-18 20:12:26 +02:00
Daniel Eklöf
2f8ee9e61d
changelog: add cglogic to ‘contributors’ 2021-04-18 20:12:02 +02:00
Daniel Eklöf
1df48fcb33
config: bold-text-in-bright: add ‘palette-based’ as a special value
When ‘bold-text-in-bright’ is set ‘to palette-based’, colors matching
one of the 8 regular palette colors are brightened by using the
corresponding bright palette color.

Other colors, or all colors if ‘bold-text-in-bright’ is set to
‘yes|true’, are brightened by increasing the luminance.
2021-04-18 20:09:10 +02:00
Daniel Eklöf
11e8ff9dc5
render: brighten: use corresponding bright palette color for base 8 colors
When brightening one of the 8 base (“regular”) colors, use the
corresponding bright palette color, instead of increasing the
luminance.

Closes #449
2021-04-18 20:09:07 +02:00
Oleh Hushchenkov
a2251a399c
Fix comment 2021-04-18 20:09:02 +02:00
Oleh Hushchenkov
98db408e1a
term: stop reading on eof 2021-04-18 20:09:01 +02:00
Daniel Eklöf
e85c19d546
term: attributes struct: use ‘bool’ instead of ‘uint32_t’ for 1-bit members 2021-04-18 20:08:58 +02:00
Daniel Eklöf
f62ac3d683
render: no need to blend fully opaque sixel images - just blit them 2021-04-18 20:08:46 +02:00
Daniel Eklöf
8561fdb004
render: don’t let URL jump label sub-surfaces extend outside window geometry
We have no guarantee that sub-surfaces extending outside the window
geometry are rendered correctly (if at all).

For example, both Sway and River will render the window border on top
of the sub-surface.

Future versions of Sway may clip the sub-surface.

Since jump-labels are positioned slightly above, and to the left of
the URLs first character, having a label on either the top row, or on
the first column, will likely position it outside the window. This is
handled by simply setting x/y to 0 (or, to -margin, since the label
coordinate is later offsetted with the window margins).

Second, if the label is very long, it may extend outside the
window. This is very unusual for labels only showing the key, and not
the URL itself, but could happen in this case too, if e.g. the user
has configured double-width key characters.

This is handled by calculating its maximum width, and then truncating
the label.

Although very unlikely, it is possible for a label to also extend
outside the window’s vertical size. This could happen for very small
font sizes, where the label’s own margins are large, relative to the
font size. This case is currently not handled.

Closes #443
2021-04-18 20:08:41 +02:00
Daniel Eklöf
4325d5a4ab
doc: foot.ini: re-phrase the box-drawings-uses-font-glyphs section 2021-04-18 20:08:35 +02:00
Daniel Eklöf
39d65bf083
doc: foot.ini: codespell: antaliasing -> antialiasing 2021-04-18 20:08:32 +02:00
Daniel Eklöf
ce321e663e
config: add box-drawings-uses-font-glyphs=no|yes option
When disabled, we render box drawing characters ourselves. This is the
default.

When enabled, we instead use font glyphs. I.e. no special treatment.

Closes #430
2021-04-18 20:08:30 +02:00
Daniel Eklöf
2efd1016ce
render: draw underline cursor below text underline
This ensures the cursor is visible on cells where the text is
underlined.

Closes #415
2021-04-18 20:08:21 +02:00
Daniel Eklöf
0f792fa1ce
changelog: rewrite entry for OSC 17/117/19/119 2021-04-18 20:08:17 +02:00
Daniel Eklöf
c005c16504
changelog: auto_left_margin on cub1 only 2021-04-18 20:08:14 +02:00
Daniel Eklöf
24e88dd224
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-18 20:08:13 +02:00
Daniel Eklöf
d620a7b3b4
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-18 20:08:08 +02:00
Daniel Eklöf
e853098f46
osc: reset background alpha when resetting the background color 2021-04-18 20:08:06 +02:00
Daniel Eklöf
713a53fa3e
doc: foot-ctlseq: mention that we support transparency in OSC 11 2021-04-18 20:08:04 +02:00
Daniel Eklöf
660b771396
changelog: don’t use a hyphen between ‘OSC’ and the number 2021-04-18 20:08:02 +02:00
Daniel Eklöf
220fdc173e
changelog: tweak wording for URxvt’s XParseColor extension 2021-04-18 20:08:00 +02:00
Daniel Eklöf
7fc3b18586
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-18 20:07:58 +02:00
Daniel Eklöf
8adb52e63a
osc: parse_rgb(): ensure ‘alpha’ has been initialized 2021-04-18 20:07:56 +02:00
Daniel Eklöf
1023f9a6e9
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-18 20:07:54 +02:00
Daniel Eklöf
f42e42246f
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-18 20:07:50 +02:00
Daniel Eklöf
275b62371f
ci: build on alpine/latest, not edge 2021-04-18 20:07:47 +02:00
Daniel Eklöf
7b0d2522ee
sixel: unhook: tighten up the condition needed for us to free image data pre-maturely 2021-04-18 20:07:35 +02:00
Daniel Eklöf
8d06278a29
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-18 20:07:31 +02:00
Daniel Eklöf
292a7c5686
config/terminal: refactor: remove “default_*” color members from terminal struct
Access the original colors in the configuration instead.
2021-04-18 20:07:29 +02:00
Daniel Eklöf
407189978e
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-18 20:07:24 +02:00
Daniel Eklöf
4a2ff28850
changelog: move OSC-4/104 fix from 1.7.1 to ‘unreleased’ 2021-04-18 20:07:19 +02:00
Daniel Eklöf
4aae54e3e7
osc: verify OSC 4/104 color index is valid
Closes #434
2021-04-18 20:07:17 +02:00
Daniel Eklöf
937ee8a509
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-18 20:07:13 +02:00
Daniel Eklöf
6e293337a9
doc: foot.ini: fix default value for delete-next-word 2021-04-18 20:07:07 +02:00
Daniel Eklöf
5dbeb5ce27
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-18 20:07:05 +02:00
Daniel Eklöf
6e782271ff
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-04-18 20:07:02 +02:00
Daniel Eklöf
0720b3177a
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-04-18 20:06:59 +02:00
Daniel Eklöf
3abde17b9e
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-04-18 20:06:52 +02:00
Daniel Eklöf
0ed40958c7
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-04-18 20:06:49 +02:00
Daniel Eklöf
6b116865f6
changelog: add new ‘unreleased’ section 2021-04-18 20:06:44 +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