Commit graph

4067 commits

Author SHA1 Message Date
Oleh Hushchenkov
dfc517f671 term: stop reading on eof 2021-04-18 13:56:56 +03:00
Daniel Eklöf
9413a18d9e
term: attributes struct: use ‘bool’ instead of ‘uint32_t’ for 1-bit members 2021-04-17 22:11:14 +02:00
Daniel Eklöf
40686303ef
main: explicitly cast log_colorize to enum fcft_log_colorize
Fixes error in Clang builds:

  ../../foot/main.c:376:19: error: implicit conversion from enumeration type 'enum log_colorize' to different enumeration type 'enum fcft_log_colorize' [-Werror,-Wenum-conversion]
      fcft_log_init(log_colorize, as_server && log_syslog, log_level + 1);
      ~~~~~~~~~~~~~ ^~~~~~~~~~~~
2021-04-17 20:09:39 +02:00
Daniel Eklöf
353c2f012a
main: call fcft_log_init(). Note that this requires fcft >= 2.3.90 2021-04-17 19:31:17 +02:00
Daniel Eklöf
98d77b94c1
Merge branch 'sixel-dont-blend-opaque-images' 2021-04-14 12:07:23 +02:00
Daniel Eklöf
6332ed487d
render: no need to blend fully opaque sixel images - just blit them 2021-04-14 11:09:02 +02:00
Daniel Eklöf
4cb8172373
Merge branch 'dont-let-jump-labels-extend-outside-window-geometry'
Closes #443
2021-04-10 18:54:50 +02:00
Daniel Eklöf
c6848678ad
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-10 13:23:20 +02:00
Daniel Eklöf
610b96b39d
doc: foot.ini: re-phrase the box-drawings-uses-font-glyphs section 2021-04-10 11:24:23 +02:00
Daniel Eklöf
f78ba6653f
Merge branch 'optionally-render-box-drawing-characters-using-font-glyphs'
Closes #430
2021-04-10 11:11:47 +02:00
Daniel Eklöf
97bc740d3d
Merge branch 'underline-cursor-below-text-underline'
Closes #415
2021-04-10 11:10:51 +02:00
Daniel Eklöf
1f522c8de1
doc: foot.ini: codespell: antaliasing -> antialiasing 2021-04-09 23:54:36 +02:00
Daniel Eklöf
0713ab45c6
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-09 23:21:20 +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