Commit graph

37 commits

Author SHA1 Message Date
Daniel Eklöf
b15032d223
selection: text_from_{clipboard,primary}: add 'done' callback
This callback is *always* called, including when there has been an
error.

This is in preparation for making text_from_{clipboard,primary}
asynchronous.
2019-11-05 08:49:32 +01:00
Daniel Eklöf
9f1525aef7
Rename: vt_to_slave() -> term_to_slave() 2019-11-03 00:52:24 +01:00
Daniel Eklöf
1adab32906
term: wayland struct is now not a part of the terminal struct
We do however need access to it, so provide a pointer. The difference
is that now we can have a *single* wayland instance, but multiple
terminal instances.
2019-10-27 18:51:14 +01:00
Daniel Eklöf
9f0b1f94c2
wayland: change all wayland callbacks to take a wayland pointer
Instead of passing the terminal to the wayland callbacks, pass a
'struct wayland' pointer.
2019-10-27 18:43:07 +01:00
Daniel Eklöf
f1e94aef2c
osc: xparsecolor: parse 'legacy' colors 2019-08-28 17:29:03 +02:00
Daniel Eklöf
675504308a
osc: add debug logs when colors are changed and reset 2019-08-21 18:54:12 +02:00
Daniel Eklöf
d8fb80ea32
term: rename colors256 -> table 2019-08-21 18:50:24 +02:00
Daniel Eklöf
631e0c0870
term: use colors256 array for *all* colors
That is, remove the 'regular' and 'bright' color arrays. This is
possible since the 256-color array is defined such that the first 16
colors map to the regular and bright colors.
2019-08-21 18:47:48 +02:00
Daniel Eklöf
65e4b93a03
osc: fix indexing into 'bright' color array 2019-08-21 18:02:18 +02:00
Daniel Eklöf
52ece3592c
osc: implement "change color" commands
This implements OSC 4, 10, 11 - change <color>/foreground/background,
and their corresponding 'query' variant (which was already implemented
for OSC 10/11).

It also implements OSC 104, 110, 111 - reset
<color>/foreground/background.

Set corresponding terminfo entries to signal this support to clients.
2019-08-21 17:57: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
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
6e233f8272
osc: remove TODO 2019-08-03 15:53:13 +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
8acc3b891d
vt: remove almost all abort() calls
Replace with generic error log messages that simply says the
ESC/CSI/OSC sequence is unhandled. This can mean either invalid or
unimplemented, depending on the context.
2019-07-30 21:42:46 +02:00
Daniel Eklöf
812178673e
osc: ignore OSC 30 (konsole's "set tab title") 2019-07-23 17:55:25 +02:00
Daniel Eklöf
196f9d67c2
term: group 'flash' state together in a struct 2019-07-22 19:15:56 +02:00
Daniel Eklöf
61409d40e2
flash: convert our own 'flash' from a CSI to an OSC 2019-07-22 19:10:15 +02:00
Daniel Eklöf
97350f6488
term: track current window title in terminal struct 2019-07-21 17:35:53 +02:00
Daniel Eklöf
29d855d7c6
term: prepare for configurable colors; add color variables to terminal 2019-07-21 10:58:09 +02:00
Daniel Eklöf
b18478f9b6
osc: add TODO 2019-07-19 15:15:59 +02:00
Daniel Eklöf
feac7d032e
osc: delete empty line 2019-07-19 14:57:55 +02:00
Daniel Eklöf
ed609b9082
osc: implement OSC 52;c;? - query clipboard 2019-07-19 14:20:38 +02:00
Daniel Eklöf
fd07f13f2a
osc: initial implementation of OSC 52 - copy to clipboard 2019-07-19 11:13:07 +02:00
Daniel Eklöf
f2608bf4c9
osc: foreground/background reply is now in correct XParseColor format
The format we used previously was a discouraged and obsolete
format (and incorrect too).
2019-07-19 10:18:22 +02:00
Daniel Eklöf
153628a217
osc: allocate data buffer dynamically 2019-07-19 08:59:35 +02:00
Daniel Eklöf
95ff37afd7
osc: terminate reply with ST rather than BEL
This is the preferred terminator anyway, and at least Emacs likes it a
whole lot better.
2019-07-18 19:54:30 +02:00
Daniel Eklöf
13d3985ba8
osc: implement foreground/background query 2019-07-18 19:48:13 +02:00
Daniel Eklöf
288cee0c1f
osc: recognize, but ignore, 112 (reset text cursor color) 2019-07-16 10:20:20 +02:00
Daniel Eklöf
d63629b370
performance improvements
* action() returns void - this gets rid of checks in vt_from_slave()
* split up ACTION_PRINT into ACTION_PRINT (ASCII) and ACTION_UTF8_PRINT
  ACTION_PRINT is on the hot path, and we want it streamlined.
* Remove run-time checkout for unimplemented state transitions, as we
  shouldn't have any of those left.
* Don't re-load current VT state on each iteration in vt_from_slave()
2019-07-07 16:32:18 +02:00
Daniel Eklöf
450f6c7dcc
osc: recognize, but ignore, OSC 104 and OSC 105 2019-07-05 19:04:34 +02:00
Daniel Eklöf
b69282545c
osc: fix param calculation with more than one digit 2019-07-05 19:04:09 +02:00
Daniel Eklöf
1947d33868
render: break out rendering functions to render.{c,h} 2019-07-05 10:16:56 +02:00
Daniel Eklöf
3ba1721c0f
osc: implement change window title and icon 2019-07-05 09:50:35 +02:00
Daniel Eklöf
1373d18dbc
logging: disable debug logging by default 2019-07-03 20:21:03 +02:00
Daniel Eklöf
2a4c08b941
wip: vt parsing: initial csi/osc dispatching 2019-06-15 22:22:44 +02:00