summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal/term-parser.c
Commit message (Collapse)AuthorAgeFilesLines
* shared: utf8 - support ucs4 -> utf8Tom Gundersen2014-12-221-43/+0
| | | | | Originally we only supported ucs2, so move the ucs4 version from libsystemd-terminal to shared and use that everywhere.
* terminal/screen: perform bold->light conversion only on foregroundDavid Herrmann2014-10-051-2/+2
| | | | | Bold glyphs always use light colors. However, this color conversion is limited to the foreground color, so skip it for backgrounds.
* terminal/screen: add color converterDavid Herrmann2014-10-031-0/+116
| | | | | | | | | | Terminals use pseudo color-codes mixed with 8bit and 24bit colors. Provide a color-converter so external renderers only have to deal with ARGB32 colors. This requires a color-palette as input as there's no fixed mapping. We provide a default, but maybe we wanna support external palettes in the future.
* terminal: make utf8 decoder return lengthDavid Herrmann2014-10-031-11/+13
| | | | | | | | | | Lets return the parsed length in term_utf8_decode() instead of a buffer pointer. Store the pointer in the passed argument. This makes it adhere to the systemd coding-style, were we always avoid returning pointers, but store them in output arguments. In this case, the storage is not allocated, so it doesn't fit 100% to this idiom, but still looks much nicer.
* terminal: silence warningThomas Hindoe Paaboel Andersen2014-07-181-1/+2
|
* terminal: add parser state-machineDavid Herrmann2014-07-181-0/+1626
The term-parser is used to parse any input from TTY-clients. It reads CSI, DCS, OSC and ST control sequences and normal escape sequences. It doesn't do anything with the parsed data besides detecting the sequence and returning it. The caller has to react to them. The parser also comes with its own UTF-8 helpers. The reason for that is that we don't want to assert() or hard-fail on parsing errors. Instead, we treat any invalid UTF-8 sequences as ISO-8859-1. This allows pasting invalid data into a terminal (which cannot be controlled through the TTY, anyway) and we still deal with it in a proper manner. This is _required_ for 8-bit and 7-bit DEC modes (including the g0-g3 mappings), so it's not just an ugly fallback because we can (it's still horribly ugly but at least we have an excuse).