Commit graph

51 commits

Author SHA1 Message Date
Daniel Eklöf
ae7383189a
osc: fix scaling of RGB formatted color specifiers 2020-05-02 23:07:26 +02:00
Daniel Eklöf
9eda632c97
osc: OSC 12: mimic xterm - a color value of 0 means use inverted fg/bg 2020-05-02 23:00:21 +02:00
Daniel Eklöf
db9b99e8ac
osc: fix 'OSC 12 ?' to return the cursor color, not the cursor text color 2020-05-02 22:58:30 +02:00
Daniel Eklöf
ac58d05c6b
osc: fix scaling of legacy formatted color specifiers 2020-05-02 22:57:12 +02:00
Daniel Eklöf
5b67e97fc2
osc 104: handle multiple indices the same way we do in OSC 4 - use strtok() 2020-04-04 14:30:50 +02:00
Daniel Eklöf
ae1b235eaa
osc: 4: handle multiple idx;spec pairs 2020-04-04 14:27:44 +02:00
Daniel Eklöf
7466e87a31
osc: ignore OSC 7 when hostname doesn't match our own hostname 2020-04-03 20:15:54 +02:00
Daniel Eklöf
5d702e6fbf
osc: implement OSC 12 and OSC 112 (set/reset text cursor color) 2020-01-20 18:36:19 +01:00
Daniel Eklöf
c3a23cf5b7
osc: implement OSC 7 - set PWD
OSC 7 updates the terminal's view of the current working
directory. The format is OSC 7;URI ST

We decode the URI and updates the term structs 'cwd' member.

This is then used when spawning a new terminal instance.
2019-12-21 19:42:59 +01:00
Daniel Eklöf
d6065ef659
osc: spell "#if 0" correctly 2019-12-19 19:55:52 +01:00
Daniel Eklöf
e7abd6ce97
osc: commented out beginning of OSC 777
I haven't decided if I want to support this
2019-12-19 07:28:10 +01:00
Daniel Eklöf
616896e2a5
csi/ocs/vt: log unhandled/unrecognized sequences as debug messages
Having them as error messages was nice when we where still missing
lots of sequences.

Now we don't anymore, and these just spam stdout as well as syslog
when e.g. cat:ing binary data.
2019-11-29 23:59:24 +01:00
Daniel Eklöf
b58fd1c205
osc 52: default to 'clipboard' if no source/target has been specified 2019-11-28 20:56:55 +01:00
Daniel Eklöf
1980345618
osc: copy to/from clipboard: alias 's' to 'p'
'p' means 'primary', while 's' means 'selection'. Thus, a client can
now request 'selection' clipboard data and will receive it from the
primary selection.
2019-11-19 14:05:31 +01:00
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