Commit graph

4281 commits

Author SHA1 Message Date
Daniel Eklöf
53516aceec
config: add url.protocols
This makes the protocols recognized by auto-detected URLs
configurable.

Closes #531
2021-05-22 14:50:47 +02:00
Daniel Eklöf
0f483d65ce
config: move url-mode related options to a dedicated section, ‘url’ 2021-05-22 14:50:47 +02:00
Daniel Eklöf
28d27f49bf
Merge branch 'underline-cursor-thickness'
Closes #524
2021-05-22 14:49:42 +02:00
Daniel Eklöf
1b5c849994
config: add cursor.underline-thickness
Works in pretty much the same way as ‘beam-thickness’, except that the
default value is “the font’s underline thickness”.

This means, that when unset, the cursor underline thickness scales
with the font size.

But, when explicitly set, either to a point size value, or a pixel
size, it remains fixed at that size.

Closes #524
2021-05-22 14:49:25 +02:00
Daniel Eklöf
af428d544f
Merge branch 'fdm-always-check-for-signals'
Closes #534
2021-05-22 14:47:44 +02:00
Daniel Eklöf
890dbc49cf
fdm: always check for signals after epoll_pwait(), not only on EINTR
This fixes an issue where we, at least on FreeBSD, sometimes get stuck
in epoll_pwait() after the shell has exited.

It turned out to be because the SIGCHLD signal was delivered at the
same time FDs were made readable/writeable. I.e. epoll_pwait()
returned a non-zero value even though it should have been interrupted
by the SIGCHLD.

To avoid having to search the entire signal array *every time*
epoll_pwait() returns, add a flag that is set in the signal
handler. This tells the FDM to scan the signal array after returning
from epoll_pwait().
2021-05-21 20:00:45 +02:00
Daniel Eklöf
b75bd6507a
notifications: use \e[22m to disable bold
\e[21m was previously used to disable bold. That changed a while ago,
to align foot with the majority of other terminal emulators.

\e[22m now disables both bold and dim.

When this change was done, the user notifications were not updated,
meaning the ‘message’ part was always in bold. This was never the
intended behavior.
2021-05-20 17:51:04 +02:00
Daniel Eklöf
ebc0bc83e0
Merge branch 'irc-update' 2021-05-20 07:46:03 +02:00
Daniel Eklöf
ac33f24b02
readme: remove my name from the IRC details 2021-05-20 07:45:21 +02:00
Craig Barnes
18364fd547 readme/doc: update details for IRC channel 2021-05-19 22:30:08 +01:00
Craig Barnes
74f740c975 vt: limit maximum value of params in vt_param_get()
So that the value is clamped to the range [0, 0x7fffffff] and retains
the same value, regardless of whether it's interpreted as a signed or
unsigned integer.

Closes #522
2021-05-17 18:15:34 +01:00
Daniel Eklöf
9fe278388b
render: stop spamming “resize” INFO logs
It _may_ be acceptable in e.g. tiling WMs, where windows are seldom
resized interactively.

But in a stacking WM where the typical way of resizing windows is by
interactive resizes, this spams way too much.
2021-05-17 19:11:56 +02:00
Daniel Eklöf
09eefabf33
grid: disable timing of resize operations 2021-05-17 19:04:50 +02:00
Daniel Eklöf
3da8dc123f
Merge branch 'search-refactor-extend-word'
Closes #421
2021-05-17 18:20:12 +02:00
Daniel Eklöf
48cc9596f1
changelog: ctrl+w can now be used across lines 2021-05-17 18:19:55 +02:00
Daniel Eklöf
96b19212d3
search: match_to_end_of_word(): we update the selection ourselves
No need to call search_find_next() after doing a
search_match_to_end_of_word(), since we already *know* we have a
match, and where it is.
2021-05-17 18:14:10 +02:00
Daniel Eklöf
a6d9f01c0d
extract: move ‘strip_trailing_empty’ parameter from extra_finish() to extract_begin() 2021-05-17 18:14:10 +02:00
Daniel Eklöf
0945e71572
search: find_next(): correctly wrap row number 2021-05-17 18:14:10 +02:00
Daniel Eklöf
5e621bbdb9
search: match_to_end_of_word(): use a local macro to bump coord 2021-05-17 18:14:10 +02:00
Daniel Eklöf
1c8bdf34ce
search: match_to_end_of_word(): use has_wrapped_around() while extracting text 2021-05-17 18:14:10 +02:00
Daniel Eklöf
11f7a6616b
search: match_to_end_of_word(): we always extend the selection with at least one character 2021-05-17 18:14:10 +02:00
Daniel Eklöf
7cf0e2aae4
search: match_to_end_of_word(): skip newlines when copying from extraction buffer 2021-05-17 18:14:10 +02:00
Daniel Eklöf
e460727afd
search: match_to_end_of_word(): refactor
Rewrite match_to_end_of_word() in terms of

* selection_find_word_boundary_right()
* extract_begin() + extract_one() + extract_finish()

This adds a small overhead, in that extract_*() allocates an internal
buffer, from which we then immediately copy, into our newly resized
prompt buffer.

On the other hand, this makes the matching behavior more consistent
with regular mouse selections, and we don’t have to keep two very
similar match-to-next-word-boundary implementations in sync.
2021-05-17 18:14:10 +02:00
Daniel Eklöf
1bc9fd5fe1
extract: add extract_finish_wide(), and optionally skip stripping trailing empty cells
extract_finish() returns the extracted text in UTF-8, while
extract_finish_wide() returns the extracted text in Unicode.

This patch also adds a new argument to extract_finish{,_wide},
that when set to true, skips stripping trailing empty cells.
2021-05-17 18:14:09 +02:00
Daniel Eklöf
eab874eb06
selection: expose find_word_boundary_{left,right}() 2021-05-17 18:14:09 +02:00
Daniel Eklöf
e415f85829
search: find_next(): proper check for scrollback wrap around
Besides disallowing matches that crosses the scrollback wrap-around,
this also fixes a crash when the trying to search beyond the last
output, when the scrollback history hasn’t yet been completely filled.
2021-05-17 18:14:09 +02:00
Daniel Eklöf
f87a13bbd2
Merge branch 'box-drawing-use-pixman' 2021-05-17 18:09:16 +02:00
Daniel Eklöf
8473deeed3
box-drawing: pre-calculate the LIGHT and HEAVY thicknesses 2021-05-17 17:58:30 +02:00
Daniel Eklöf
3dbb906325
box-drawing: always pass ‘buf’ as the first parameter
This way, the compiler doesn’t have to waste instructions on
re-ordering the parameters
2021-05-17 17:58:30 +02:00
Daniel Eklöf
25ce458281
box-drawing: don’t inline _thickness()
It results in quite a lot of floating point instructions being emitted
in almost every box drawing function we have...
2021-05-17 17:58:30 +02:00
Daniel Eklöf
b48414e72c
box-drawing: use fill_boxes() instead of fill_rectangles() 2021-05-17 17:58:30 +02:00
Daniel Eklöf
b771a28d17
box-drawing: increase brightness of solid shades 2021-05-17 17:58:30 +02:00
Daniel Eklöf
e7109d6b77
config: add tweak.box-drawing-solid-shades=yes|no
When enabled, shades are rendered as solid blocks, using a darker
variant of the current foreground color.

When disabled, shades are instead rendered in a checker box pattern,
using the foreground color unmodified.

Default is enabled.
2021-05-17 17:58:30 +02:00
Daniel Eklöf
c0bd152218
box-drawing: use an a8 buffer when primary font is antialiased
This causes relevant box drawing characters (diagonals, arcs etc) to
be antialiased as well.
2021-05-17 17:58:30 +02:00
Daniel Eklöf
9264d6695c
box-drawing: change_buffer_format: abort on pixman failure 2021-05-17 17:58:30 +02:00
Daniel Eklöf
99a3b034c3
box-drawing: apply antialiasing to LIGHT ARCs
When drawing on an a8 buffer, apply antialiasing to LIGHT ARCs. This
is done by supersampling; draw to a 4 times bigger buffer, then
downsample, where each downsampled pixel is the average of the
corresponding 4x4 pixel from the supersampled buffer.

We also need to take supersampling into account while adjusting the row
and col when pixel aligning the arcs with the regular
horizontal/vertical lines.

The shape of the ARCs can still be improved. Still, this is a much
needed improvement over the current implementation.

Closes #279
2021-05-17 17:58:30 +02:00
Daniel Eklöf
3d97b8c113
box-drawing: draw_pixman_shade(): named struct initialization 2021-05-17 17:58:29 +02:00
Daniel Eklöf
977d37396f
box-drawing: fix typo: missing ‘.’ in struct member initialization 2021-05-17 17:58:29 +02:00
Daniel Eklöf
6937b1add8
box-drawing: shades can now be rendered either using solid color, or checker box
For now, switching is done using a static variable. In the future,
this could be a user option.
2021-05-17 17:58:29 +02:00
Daniel Eklöf
d495da03e1
box-drawing: temporary “fix” for LIGHT ARCs with a8 buffers
We don’t have a method to draw the arcs using pixman yet. Work around
this by replacing the a8 buffer with an a1 buffer, and render the arcs
using our old, non-antialiased, way.
2021-05-17 17:58:29 +02:00
Daniel Eklöf
5dd8a70905
box-drawing: swap amount of shade for LIGHT and DARK shades
The DARK shade is the one most dense, and thus the one that looks
brightest.
2021-05-17 17:58:29 +02:00
Daniel Eklöf
b280928084
box-drawing: draw shades as “antialiased” blocks
When rendering to an a8 surface, render shades using “transparent”
pixman rectangles.

When these glyphs are composited with a color, the resulting look is
the color, but darkened.
2021-05-17 17:58:29 +02:00
Daniel Eklöf
d6898dcc42
box-drawing: use pixman_image_fill_boxes() for rect() 2021-05-17 17:58:29 +02:00
Daniel Eklöf
e05a510a7c
box-drawing: implement LIGHT diagonal lines using pixman
Use trapezoids to rasterize the diagonal lines.
2021-05-17 17:58:29 +02:00
Daniel Eklöf
19fa1b30b8
box-drawing: rect(): implement using pixman
Use pixman_image_fill_rectangles() to render rectangles. Duh!
2021-05-17 17:58:29 +02:00
Daniel Eklöf
155537c2de
box-drawing: {h,v}line: implement using pixman
Use pixman_image_fill_rectangles() to render horizontal and vertical
lines.

Despite the name, this *is* the appropriate function to use, since our
lines *do* have a thickness, and thus *are* rectangles.
2021-05-17 17:58:29 +02:00
Daniel Eklöf
e03257d342
box-drawing: U+256C - BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL: add missing corner
The inner corner, where the upper/left lines meet, were missing
2021-05-17 17:58:29 +02:00
Daniel Eklöf
8d09ba5bd2
box-drawing: include pixman image in the buffer we’re passing around 2021-05-17 17:58:29 +02:00
Daniel Eklöf
ed60c66522
Merge branch 'reflow-performane-no-new-row-initialization'
Part of #504
2021-05-17 17:57:47 +02:00
Daniel Eklöf
1aa4a31c6f
grid: reflow: free old rows as soon as we’re done with them
This reduces the memory cost of reflowing text, as we no longer needs
to hold both the old and the new grid, in their entirety, in memory at
the same time.
2021-05-17 17:57:41 +02:00