Commit graph

1332 commits

Author SHA1 Message Date
Daniel Eklöf
afa1dbb7cc
render: add a timeout for application synchronized updates
This ensures we can recover from a crashing (or bad behaving)
application that sends a BSU but then never sends an ESU.
2020-01-12 12:40:42 +01:00
Daniel Eklöf
6e474e77e5
render: rename render_{enable,disable}_refresh() 2020-01-12 12:28:00 +01:00
Daniel Eklöf
cb8a0260f3
term: rename refresh_prohibited -> application_synchronized_updates 2020-01-12 12:25:58 +01:00
Daniel Eklöf
84f836c0c8
term: ptmx: cancel, and don't re-arm, delay timers when refresh has been disabled 2020-01-12 12:23:29 +01:00
Daniel Eklöf
7b27fa857f
dcs: bsu/esu: call render_{disable,enable}_refresh() 2020-01-12 12:21:31 +01:00
Daniel Eklöf
b2935e2b89
render: add render_{enable,disable}_refresh()
Calling render_disable_refresh() causes update requests to that
terminal to be ignored.

Calling render_enable_refresh() re-enables updates.
2020-01-12 12:19:38 +01:00
Daniel Eklöf
5ef55a7f52
dcs: abort() in bsu/esu
I **really** want to know if someone is using these...
2020-01-12 12:02:39 +01:00
Daniel Eklöf
a2652d2447
dcs: put: don't append data if buffer resize failed 2020-01-12 12:00:43 +01:00
Daniel Eklöf
a1ce31cd1d
dcs: use default param value of 0 in log message 2020-01-12 12:00:30 +01:00
Daniel Eklöf
35e696aa55
Merge branch 'dcs' 2020-01-12 11:58:53 +01:00
Daniel Eklöf
5a6cbb8c3e
dcs: initial handling of DCS in general
Add data structure to term->vt. This structure tracks the free-form
data that is passed-through, and the handler to call at the end.

Intermediates and parameters are collected by the normal VT
parser. Then, when we enter the passthrough state, we call dcs_hook().

This function checks the intermediate(s) and parameters, and selects
the appropriate unhook handler (and optionally does some execution
already).

In passthrough mode, we simply append strings to an internal
buffer. This might have to be changed in the future, if we need to
support a DCS that needs to execute as we go.

In unhook (i.e. when the DCS is terminated), we execute the unhook
handler.

As a proof-of-concept, handlers for BSU/ESU (Begin/End Synchronized
Update) has been added (but are left unimplemented).
2020-01-12 11:55:22 +01:00
Daniel Eklöf
0b30316261
render: don't bother trying to lookup glyph for empty cells
Depending on the font, it may not have an entry for code point '0',
which will cause us to try to load fallback fonts.
2020-01-12 01:19:41 +01:00
Daniel Eklöf
36d0f1fa5f
Merge branch 'switch-based-keymap-lookup' 2020-01-11 19:00:11 +01:00
Daniel Eklöf
53a437007e
input: comments 2020-01-11 18:59:46 +01:00
Daniel Eklöf
fed0e5c853
input: keymap_lookup: only do lookup, don't sent to client 2020-01-11 18:40:27 +01:00
Daniel Eklöf
1472383c15
keymap: remove keymap table
Lookup is now done in code, using a switch-statement
2020-01-11 18:37:00 +01:00
Daniel Eklöf
e658fe3da7
input: add a switch-based function that translates XKB keysym to escape data 2020-01-11 18:18:31 +01:00
Daniel Eklöf
8efedc9655
input: break out keymap lookup to a separate function 2020-01-11 17:55:45 +01:00
Daniel Eklöf
b5bb571adf
README: installation: s/debug/release/ 2020-01-11 15:02:19 +01:00
Daniel Eklöf
9f3d860e61
README: install::other: do a release build, and mention profile guided 2020-01-11 14:59:57 +01:00
Daniel Eklöf
d86b0ddc21
fcft/tllist: remove git submodules 2020-01-11 14:59:39 +01:00
Daniel Eklöf
8837309c2e
keymap: add KP enter
This makes the keypad enter key emit "\eOM" in keypad application
mode.
2020-01-11 12:37:07 +01:00
Daniel Eklöf
5956faac01
term/wayland: use MONOTONIC timers 2020-01-10 21:33:40 +01:00
Daniel Eklöf
bdc4bf2372
README: some terminal emulators call "server mode" "daemon mode" 2020-01-10 20:48:48 +01:00
Daniel Eklöf
30f6480644
keymap: add escapes for keypad 'begin'
This is usually the '5' key, in non-num lock mode.
2020-01-10 20:23:56 +01:00
Daniel Eklöf
5bfc560451
Revert "terminal: use edge-triggered FDM handler for the PTY"
This reverts commit f5e27b49eb.
2020-01-10 19:51:16 +01:00
Daniel Eklöf
3957d50a8a
Revert "selection: use edge-triggered FDM handlers"
This reverts commit 5bac3cfa2c.
2020-01-10 19:49:48 +01:00
Daniel Eklöf
ed8d7f4bae
Revert "server: use edge-triggered FDM handler for the client connections"
This reverts commit 9141b8a657.
2020-01-10 19:49:26 +01:00
Daniel Eklöf
9141b8a657
server: use edge-triggered FDM handler for the client connections 2020-01-10 19:30:03 +01:00
Daniel Eklöf
629a625422
server: be more resilient against bad behaving clients
Make both the server listening socket and the connecting client
sockets non-blocking.

Then, when reading the initial length of the setup packet, handle read
errors from partial reads separately.

Assume the client writes all four bytes of the 'length' field at once,
and bail out if we are unable to read those 4 bytes.

Limit the maximum setup packet size to 128K. This is to prevent
clients from pretending the setup packet is insanely large, causing us
to fail to malloc.
2020-01-10 19:27:17 +01:00
Daniel Eklöf
3762f1f205
terminal: make the event FD used to delay shutdown non-blocking 2020-01-10 19:25:56 +01:00
Daniel Eklöf
f5e27b49eb
terminal: use edge-triggered FDM handler for the PTY
This means that the read handler now has to keep reading until we get
EAGAIN.

But it also means we don't have to flip the EPOLLOUT flag in the FDM
handler back and forth when writing to the PTY.
2020-01-10 19:24:45 +01:00
Daniel Eklöf
5bac3cfa2c
selection: use edge-triggered FDM handlers 2020-01-10 19:24:04 +01:00
Daniel Eklöf
4e335422b8
wayland; fixup 2020-01-10 19:23:32 +01:00
Daniel Eklöf
7ce2cca49a
wayland: just to be sure, check return value of wl_display_read_events() 2020-01-10 19:23:08 +01:00
Daniel Eklöf
832e6f1370
wayland: make wayland socket non-blocking 2020-01-10 19:22:59 +01:00
Daniel Eklöf
a07de9ef3c
fdm: fix log message 2020-01-10 19:22:41 +01:00
Daniel Eklöf
698d5fdf06
fdm: verify FDs are non-blocking (debug builds only) 2020-01-10 19:22:10 +01:00
Daniel Eklöf
70f0f02016
fcft: bump 2020-01-09 21:09:25 +01:00
Daniel Eklöf
21a666e7eb
completions: zsh: add empty completions for options with required argument 2020-01-09 21:06:20 +01:00
Daniel Eklöf
40bb63e206
selection: finalize: ignore whether selections are 'enabled' or not
This fixes an issue where a "forced" selection (shift being pressed
while slave is tracking mouse events) would not finalize if the user
released shift *before* releasing the mouse button.
2020-01-06 11:59:26 +01:00
Daniel Eklöf
457eb573c4
selection: update: don't dirty cells that don't change state
Previously when updating a selection, we would unmark *all* cells in
the old selection, and then mark all cells in the new selection.

This caused *all* cells to be dirtied and thus re-rendered.

Avoid this, by adding a temporary state to the cells' selected state.

Before unmarking the old selection, pre-mark the new selection using a
temporary state.

When unmarking the old selection, ignore cells in this temporary state.
When marking the new selection, ignore cells in this temporary
state (except clearing the temporary state).
2020-01-06 11:56:18 +01:00
Daniel Eklöf
6833abf33c
selection: foreach_selection_*: must wrap row number
Fixes occasional crashes when we're at the end of the grid and
selection wraps around.
2020-01-05 15:38:45 +01:00
Daniel Eklöf
7e178d6337
search: rename render.search_offset -> render.search_glyph_offset 2020-01-05 15:25:24 +01:00
Daniel Eklöf
f209541688
Merge branch 'search-render-improvements' 2020-01-05 15:20:34 +01:00
Daniel Eklöf
5a89520274
render: ensure cursor is always visible in the search box
Maintain a view 'offset' (which glyph from the search string to start
rendering at).

This defines the start of the viewable area. The end is the offset +
the search box size (which is limited to the window size).

Adjust this offset whenever the cursor moves outside the viewable
area. For now, this is always done in the same way: set the offset to
the cursor position.

This means that when we're entering text at the end of the search
criteria (i.e. the normal case; we're simply typing), and the search
box reaches the window size, the cursor will jump to the start of the
search box, which will be empty. This could be confusing, but let's go
with for now.
2020-01-05 15:16:40 +01:00
Daniel Eklöf
ee7ff9501e
README: add 'git submodule update --init' step to how-to-install 2020-01-05 12:58:02 +01:00
Daniel Eklöf
f4e8a9c375
render: xcursor: remove render_xcursor_refresh() 2020-01-05 00:10:44 +01:00
Daniel Eklöf
00479fe204
doc: slight change of wording for mouse-drag-to-select 2020-01-04 23:56:17 +01:00
Daniel Eklöf
fdcab07663
README: abuse of definition list to get multiple paragraphs 2020-01-04 23:52:08 +01:00