Commit graph

490 commits

Author SHA1 Message Date
Daniel Eklöf
d405c7022f
doc: add foot.1 man page 2019-08-11 20:54:28 +02:00
Daniel Eklöf
1060c8e892
main: add -h,--help and -v,--version command line options 2019-08-11 16:03:29 +02:00
Daniel Eklöf
a78765a36f
README: add description of mouse middle click 2019-08-11 15:55:55 +02:00
Daniel Eklöf
9235738ea1
READNE: fontconfig's fallback _can_ be used, but isn't preferred 2019-08-11 15:55:23 +02:00
Daniel Eklöf
00b6948d9f
font: cleanup 2019-08-10 21:10:56 +02:00
Daniel Eklöf
92319d1570
font: initial support for fontconfig font fallback
When we've exhausted our own fallback list, try the font list provided
by fontconfig.

This means, the user's fallback fonts have priority, but in case all
of them fail, we hopefully get lucky with fontconfig...
2019-08-10 20:34:22 +02:00
Daniel Eklöf
75830ba016
selection: regression: last cell wasn't included in copied text 2019-08-10 20:22:02 +02:00
Daniel Eklöf
15afd26716
osc: implement copy/paste to/from primary 2019-08-09 21:27:51 +02:00
Daniel Eklöf
70b6d9d7d2
input: don't paste from primary if client is mouse tracking 2019-08-09 21:26:34 +02:00
Daniel Eklöf
356c5a28b5
README: remove empty lines in between list items 2019-08-08 22:37:00 +02:00
Daniel Eklöf
caeda96b05
README: initial readme 2019-08-08 22:35:55 +02:00
Daniel Eklöf
d4a25f7f96
config: remove old, commented out code 2019-08-08 22:20:58 +02:00
Daniel Eklöf
14d4a0a1c6
term: don't send mouse events if shift is being pressed 2019-08-08 17:58:50 +02:00
Daniel Eklöf
28a8b18c5e
selection: allow selection when mouse tracking is enabled *if* shift is pressed 2019-08-08 17:58:24 +02:00
Daniel Eklöf
2a8962fd1a
render: selection may not be "ordered", since it may not have been finalized 2019-08-08 17:58:06 +02:00
Daniel Eklöf
83a10402af
font: improve logging 2019-08-08 17:57:58 +02:00
Daniel Eklöf
bab6f1d6bf
csi: cancel selection *before* switching grid
This fixes an occasional SIGSEGV
2019-08-08 17:57:21 +02:00
Daniel Eklöf
481a1cd678
selection/input: triple click selects an entire row 2019-08-06 19:32:06 +02:00
Daniel Eklöf
ae84f0ee00
main: make all polled FDs non-blocking
And handle read() returning EAGAIN.

This fixes an issue with the keyboard repeat timer, which sometimes
would return EAGAIN.

Most likely because POLLIN was set on it, but then before we get to
handle it, the timer was canceled (by a key up event).
2019-08-05 20:30:06 +02:00
Daniel Eklöf
c06f141189
term: cancel selection when scrolling wraps
If we scroll enough, we'll eventually end up wrapping around the
entire scrollback buffer. At this point, a selection is no longer
valid, so cancel it.

Note: this was very obvious when scrolling in the alt screen, since
its scrollback buffer is what you see on the screen (i.e. it has no
scrollback).
2019-08-05 20:16:17 +02:00
Daniel Eklöf
1e08d93528
selection: ensure start < end in finalize
When the selection is finalized, swap start/end if necessary, to make
sure start <= end.
2019-08-05 20:15:18 +02:00
Daniel Eklöf
a82f12dd2b
input: use a timer fd to handle keyboard key repeat
Instead of running a repeater thread that writes the key to repeat
over a pipe, use a simple timer fd.

No more locking or condition signalling. No need to track
start/stop/exist states.

We simply set up the initial timeout value to be the 'delay', and the
interval to be the repeat 'rate'.
2019-08-05 19:33:01 +02:00
Daniel Eklöf
c62ce72778
selection: mark-word using spaces only as word separator
When the user double-clicks with ctrl pressed, we now select the word
under the cursor using spaces only as word separator.
2019-08-05 19:02:27 +02:00
Daniel Eklöf
528ee9925c
term: re-order switch-cases to be in X button order 2019-08-05 18:59:12 +02:00
Daniel Eklöf
c15d546740
term: fix mouse button mapping to X button numbers
BACK should be 4, FORWARD 5.
2019-08-05 18:32:35 +02:00
Daniel Eklöf
3ae210d4c5
selection: only disable selection when mouse drag/motion is on
This allows us to select text in e.g. man/less while still being able
to use LESS=--MOUSE (i.e. enable scrolling with mouse).
2019-08-04 19:15:50 +02:00
Daniel Eklöf
42fdb3653d
scrollback: use scroll damage to speed up scrolling
When scrolling through the scrollback lines, use scroll damage instead
of re-rendering the entire screen whenever it makes sense. I.e. when
the number of lines isn't a whole page or more.
2019-08-04 19:06:49 +02:00
Daniel Eklöf
c411dedc3b
render: make sure the current view is allocated and visible 2019-08-04 18:34:14 +02:00
Daniel Eklöf
e2e1db8faf
csi: add 'unimplemented' warnings for things we handle but ignore 2019-08-04 18:11:59 +02:00
Daniel Eklöf
8deead14e8
selection: insert newlines only when last column is empty 2019-08-04 13:07:54 +02:00
Daniel Eklöf
e2229c7e2e
osc: bug: uneven clipboard bytes where not buffered correctly
When responding to a OSC 52 clipboard request, we need to base64
encode the clipboard data.

This is done in, potentially, several calls. Since we need at least 3
bytes to be able to produce any base64 output, we may have to buffer
up to 2 bytes between the callback calls with clipboard data.

This was being done incorrectly, where both bytes were written to
index 0 in the buffer.
2019-08-03 21:30:06 +02:00
Daniel Eklöf
9a0d440e95
term: cell erase: reset *all* attributes *except* background 2019-08-03 19:26:02 +02:00
Daniel Eklöf
6e233f8272
osc: remove TODO 2019-08-03 15:53:13 +02:00
Daniel Eklöf
4d7993b36f
cell: pack more efficiently and store glyph as a wchar
The 'attributes' struct is now 8 bytes and naturally packed (used to
be 9 bytes, artificially packed).

'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes,
artificially packed).

Furthermore, the glyph is stored as a wchar instead of a char*. This
makes it easier (faster) to do glyph lookup when rendering.
2019-08-02 18:19:07 +02:00
Daniel Eklöf
ab92abbd21
term: implement reset 2019-08-01 20:51:11 +02:00
Daniel Eklöf
57564c2b59
render: special case worker-count == 0
Allow render worker count to be 0, in which case the main thread
renders the entire screen.
2019-08-01 20:09:39 +02:00
Daniel Eklöf
bd734d5bed
threads: set thread titles 2019-08-01 20:09:16 +02:00
Daniel Eklöf
4801e39eae
conf: make number of scrollback lines configurable 2019-08-01 20:08:39 +02:00
Daniel Eklöf
67b4b9401d
render: always damage two cells when rendering the cursor
Hack to render cursor-at-double-width-characters correctly. Should be
replaced with something better.
2019-07-31 21:16:37 +02:00
Daniel Eklöf
4a01be5522
render: draw cell decorations (cursor, underline etc) correctly for double-width characters 2019-07-31 21:15:40 +02:00
Daniel Eklöf
858a0d9906
font: initial support for double-width *and* color emoji glyphs
Fonts are now loaded with FT_LOAD_COLOR and we recognize and support
the FT_PIXEL_MODE_BGRA pixel mode.

This is mapped to a CAIRO_FORMAT_ARGB32 surface, that is blitted
as-is (instead of used as a mask like we do for gray and mono glyphs).

Furthermore, since many emojis are double-width, we add initial
support for double-width glyphs.

These are assumed to always be utf8. When PRINT:ing an utf8 character,
we check its width, and add empty "spacer" cells after the cell with
the multi-column glyph.

When rendering, we render the columns in each row backwards. This
ensures the spacer cells get cleared *before* we render the glyph (so
that we don't end up erasing part of the glyph).

Finally, emoji fonts are usually bitmap fonts with *large*
glyphs. These aren't automatically scaled down. I.e. even if we
request a glyph of 13 pixels, we might end up getting a 100px glyph.

To handle this, fontconfig must be configured to scale bitmap
fonts. When it is, we can look at the 'scalable' and 'pixelsizefixup'
properties, and use these to scale the rendered glyph.
2019-07-31 18:03:35 +02:00
Daniel Eklöf
748a1f229c
vt: disable flash on bell, it's too annoying in e.g. zsh 2019-07-30 22:11:32 +02:00
Daniel Eklöf
e1f7fc459b
vt: BELL is now logged at info level, and flashes the screen 2019-07-30 22:09:07 +02:00
Daniel Eklöf
0d1ba1ffb2
osc: reduce flash interval to 50ms 2019-07-30 22:08:58 +02:00
Daniel Eklöf
e3dc184882
term: break out 'flash' to a separate 'term' function 2019-07-30 22:06:02 +02:00
Daniel Eklöf
89f1b3ae73
footrc: add 'workers' 2019-07-30 22:03:13 +02:00
Daniel Eklöf
db6939fdc5
config: remove commented out code 2019-07-30 22:03:07 +02:00
Daniel Eklöf
10536aad3f
render: make resize log messages debug messages 2019-07-30 22:01:49 +02:00
Daniel Eklöf
caaf84dfd3
main: don't shadow final return value inside poll loop 2019-07-30 22:01:16 +02:00
Daniel Eklöf
b82dc02505
selection: add a couple of word-breaking characters
When "auto-selecting" a word, we used to only break on space
characters. Now we break on a number of other characters as
well.
2019-07-30 21:57:48 +02:00