Commit graph

427 commits

Author SHA1 Message Date
Daniel Eklöf
44db2e2d0a
changelog: move line-height entry from ‘changed’ to ‘added’ 2021-01-11 09:31:22 +01:00
Daniel Eklöf
a455797bf2
changelog: line-height, letter-spacing and {horizontal,vertical}-letter-offset 2021-01-11 09:31:07 +01:00
FollieHiyuki
bb1b8bc7ca Add fish completion 2021-01-08 20:37:33 +03:00
Daniel Eklöf
e14c592f39
config: add optional ‘center’ argument to ‘pad’
When set, the grid contents is centered in the window. I.e. the
left/right and top/bottom margins are equal (+- 1px).

This causes the content to “jump” while doing an interactive resize,
but may still be preferred in e.g. a tiling WM.

Closes #273
2021-01-06 11:17:29 +01:00
Daniel Eklöf
a1b52ee4a0
changelog: double- or triple clicking then dragging extends word- or line-wise 2021-01-04 19:48:40 +01:00
Daniel Eklöf
482690e5fb
render: draw combining characters on top of colored bitmap glyphs (emoji) 2021-01-04 18:32:55 +01:00
Peter Colberg
49ec4c79a7 Add myself to Contributors 2021-01-03 15:49:24 -05:00
Peter Colberg
afc343d528 Require trailing comment to be preceded by a space or tab
Fixes `word-delimiters` option to not ignore `#` and subsequent characters.

Closes #270
2021-01-03 14:08:25 -05:00
Daniel Eklöf
5cc2f94668
Merge branch 'box-drawing'
Closes #198
2021-01-03 00:08:08 +01:00
Daniel Eklöf
ae6d8e0c7f
render: mark cell overflowed into as dirty
When tweak.allow-overflowing-double-width-glyphs=yes, then certain
glyphs are allowed to overflow into the neighbouring cell.

However, if the cell “owning” the double-width glyph is erased (_only_
that cell), then the cell overflowed into is not redrawn, causing
part of the double-width glyph to remain on screen.

To avoid checking for these glyphs when printing to the terminal (i.e
at parse time), simply mark both cells as dirty when we render the
overflowing glyph.

Yes, this means that the cells will always be re-rendered. We count on
them only making up a small portion of the screen.
2021-01-02 22:31:07 +01:00
Daniel Eklöf
71d187119f
changelog: box drawing characters are rendered by foot 2021-01-01 21:09:39 +01:00
Daniel Eklöf
cda647f2ca
changelog: update ‘contributors’ 2020-12-26 12:14:07 +01:00
Daniel Eklöf
2227e36c66
ime: don’t call text-input functions when it isn’t available
Closes #259
2020-12-26 12:09:48 +01:00
Daniel Eklöf
8b0ef6aa85
terminal: shutdown (or --hold) when the client process terminates
Shutdown the terminal when the client process terminates, not when the
ptmx file descriptor is closed.

This fixes an issue where the terminal remains running after the
client process has terminated, if it spawned child processes that
inherited the ptmx file descriptor.
2020-12-26 01:29:40 +01:00
Daniel Eklöf
78da147e80
Merge branch 'releases/1.6' 2020-12-21 16:00:00 +01:00
Daniel Eklöf
c6a53d5e33
meson/pkgbuild: bump version to 1.6.2 2020-12-21 15:58:25 +01:00
Daniel Eklöf
71d1515a05
Merge branch 'releases/1.6' 2020-12-21 13:55:19 +01:00
Daniel Eklöf
7c3cb008ec
changelog: prepare for 1.6.1 2020-12-21 13:50:27 +01:00
Daniel Eklöf
b6b565cc9a
changelog: mention -Wno-profile-instr-unprofiled 2020-12-21 13:50:06 +01:00
Daniel Eklöf
1ad63a5c58
changelog: mention --seed in in generate-alt-random.pu 2020-12-21 13:47:45 +01:00
Daniel Eklöf
68dd9c17d5
generate-alt-random: ioctl(TIOCGWINSZ) may fail in run inside a container
This _should_ only happen when we’re doing a partial PGO build, since
then the script is run in the parent terminal. In this case, the user
is expected to use --rows/--cols anyway.
2020-12-21 13:42:59 +01:00
Daniel Eklöf
e4ae5a7586
generate-alt-random: ioctl(TIOCGWINSZ) may fail in run inside a container
This _should_ only happen when we’re doing a partial PGO build, since
then the script is run in the parent terminal. In this case, the user
is expected to use --rows/--cols anyway.
2020-12-21 13:40:53 +01:00
Daniel Eklöf
505680087c
changelog: use -std=c11 instead of -std=c18 2020-12-21 12:28:29 +01:00
Daniel Eklöf
e95798e608
changelog: use -std=c11 instead of -std=c18 2020-12-21 12:20:08 +01:00
Daniel Eklöf
e4620071b0
Merge branch 'releases/1.6' 2020-12-20 15:51:04 +01:00
Daniel Eklöf
fbe9f54db0
changelog: update ‘contributors’ 2020-12-20 15:49:24 +01:00
Daniel Eklöf
533db90a94
changelog: remove trailing ‘5’ 2020-12-20 15:48:25 +01:00
Daniel Eklöf
a2ce0622c5
render: fix rounding error when calculating background color with alpha
We use pre-multiplied alpha color channels, but were having bad
rounding errors due to the alpha divider being truncated to an
integer.

The algorithm for pre-multiplying a color channel is:

  alpha_divider = 0xffff / alpha
  pre_mult_color = color / alpha_divider

In order to fix the rounding errors, we could turn ‘alpha_divider’
into a double.

That however would introduce a performance penalty since now we’d need
to do floating point math for each cell.

The algorithm can be trivially converted to:

  pre_mult_color = color * alpha / 0xffff

Since both color and alpa values are < 65536, the multiplication is
“safe”; it will not overflow an uint32_t.

Closes #249
2020-12-20 15:46:32 +01:00
Daniel Eklöf
3fd60d4975
changelog: mention meson dependency fix 2020-12-20 15:46:24 +01:00
Daniel Eklöf
b976d10f7d
changelog: add 1.6.1 section 2020-12-20 15:46:05 +01:00
Craig Barnes
9e7d108afd
changelog: fix link to "1.6.0" heading 2020-12-20 15:44:09 +01:00
Daniel Eklöf
ede5661d50
changelog: update ‘contributors’ 2020-12-20 15:42:32 +01:00
Daniel Eklöf
c60c8d93f7
Merge branch 'subproject-wrap' 2020-12-20 14:37:02 +01:00
Daniel Eklöf
339acc57cf
render: fix rounding error when calculating background color with alpha
We use pre-multiplied alpha color channels, but were having bad
rounding errors due to the alpha divider being truncated to an
integer.

The algorithm for pre-multiplying a color channel is:

  alpha_divider = 0xffff / alpha
  pre_mult_color = color / alpha_divider

In order to fix the rounding errors, we could turn ‘alpha_divider’
into a double.

That however would introduce a performance penalty since now we’d need
to do floating point math for each cell.

The algorithm can be trivially converted to:

  pre_mult_color = color * alpha / 0xffff

Since both color and alpa values are < 65536, the multiplication is
“safe”; it will not overflow an uint32_t.

Closes #249
2020-12-20 12:25:12 +01:00
Daniel Eklöf
9a0a642a5e
changelog: mention meson dependency fix 2020-12-20 11:56:18 +01:00
Craig Barnes
da47deee10 changelog: fix link to "1.6.0" heading 2020-12-19 22:50:18 +00:00
Craig Barnes
013cca646d meson: use wrap files for fcft/tllist subprojects
See: https://mesonbuild.com/Wrap-dependency-system-manual.html
2020-12-19 22:43:09 +00:00
Daniel Eklöf
9dff817d31
changelog: add new ‘unreleased’ section 2020-12-18 15:02:08 +01:00
Daniel Eklöf
8cc179cc53
changelog: prepare for 1.6.0 2020-12-18 14:51:34 +01:00
Daniel Eklöf
59e4243f2a
changelog: move entry for dpi-aware up, to make it more visible 2020-12-18 14:46:56 +01:00
Daniel Eklöf
c1dc38e813
changelog: use code/monospace highlighting for foot.ini config options 2020-12-18 14:46:16 +01:00
Daniel Eklöf
5c59e38cf4
Merge branch 'dpi-aware-when-scaling-factor-is-one' 2020-12-18 14:42:48 +01:00
Daniel Eklöf
fa93a97a08
terminfo: add status line capabilities: hs, dsl, fsl and tsl
* hs  - boolean, signals status line availability
* tsl - to_status_line: begin an OSC 2 sequence (set window title)
* fsl - from_status_line: OSC terminator
* dsl - disable status line: \E]2;\E\\ - clears the window title

Closes #242
2020-12-18 13:46:57 +01:00
Daniel Eklöf
0a821f2ed4
fonts: size fonts using the scaling factor when output scaling is enabled
This extends the new ‘dpi-aware’ option with a new default value,
‘auto’.

When set to ‘auto’, fonts are sized using monitors’ DPI when output
scaling is disabled. When output scaling is enabled, fonts are instead
sized using the scaling factor.

The reasoning here is that a user that has enabled output scaling is
obviously *not* relying on DPI scaling.

Output scaling can also be a way to compensate for different viewing
distances, in which case we do *not* want to break that by using DPI
scaling.

Users can still force DPI-only font sizing by setting ‘dpi-aware=yes’,
or disable it completely by setting ‘dpi-aware=no’.
2020-12-17 12:05:22 +01:00
Daniel Eklöf
2e137c0a7e
vt: don’t ignore extra private/intermediate characters
Take ‘\E(#0’ for example - this is *not* the same as ‘\E(0’.

Up until now, foot has however treated them as the same escape,
because the handler for ‘\E(0’ didn’t verify there weren’t any _other_
private characters present.

Fix this by turning the ‘private’ array into a single 4-byte
integer. This allows us to match *all* privates with a single
comparison.

Private characters are added to the LSB first, and MSB last. This
means we can check for single privates in pretty much the same way as
before:

  switch (term->vt.private) {
  case ‘?’:
      ...
      break;
  }

Checking for two (or more) is much uglier, but foot only supports
a *single* escape with two privates, and no escapes with three or
more:

  switch (term->vt.private) {
  case 0x243f:  /* ‘?$’ */
      ...
      break;
  }

The ‘clear’ action remains simple (and fast), with a single write
operation.

Collecting privates is potentially _slightly_ more complex than
before; we now need mask and compare, instead of simply comparing,
when checking how many privates we already have.

We _could_ add a counter, which would make collecting privates easier,
but this would add an additional write to the ‘clean’ action which is
really bad since it’s in the hot path.
2020-12-16 14:30:49 +01:00
Daniel Eklöf
db097891f2
csi: implement DECRQM (DEC modes), for real
Previously, we always returned ‘2 - reset’, instead of the actual
state of the requested mode.
2020-12-16 13:57:40 +01:00
Daniel Eklöf
37f036f9e9
changelog: ECMA-4*8* 2020-12-16 10:33:04 +01:00
Daniel Eklöf
066b2297ef
changelog: group ‘bell’ entries together 2020-12-16 10:32:21 +01:00
Daniel Eklöf
0d6b5f522e
config_font_parse(): return fail/success 2020-12-15 18:55:27 +01:00
Daniel Eklöf
04703c07f0
csi: SGR 21 is “double underline”, not “disable bold” (according to ECMA-48) 2020-12-14 19:10:30 +01:00