| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
| |
To handle text reflow correctly when a line has a printable character
in the last column, but was still line breaked, we need to track the
fact that the slave inserted a line break here.
Otherwise, when the window width is increased, we'll end up pulling up
the next line, when we really should have inserted a line break.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We only support 16 parameters, and for each parameter, 16
sub-parameters. If we ever hit that limit (or rather, if the client
writes 17 (sub) parameters), log this and stop incrementing the
parameter index variable.
For performance reason, we implement the following behavior:
* We never increment the parameter index past the supported
number. This ensures all code *accessing* the parameter list can do
so without verifying the validity of the index.
* The *first* time we see too many parameters, and the first time we
see too many sub parameters, log this. Then *never* log again. Even
if we see too many parameters in a completely different escape. This
is so that we don't have to keep a "have warned" boolean in the
terminal struct, but can use a simple function local static
variable.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
0x3a/0x3b are ':' and ';'. These should not only switch to the 'csi
param' state, but also be parsed as a parameter.
This fixes an issue where a multi-parameter escape with the first
parameter omitted was parsed incorrectly - as if the first parameter
wasn't there.
I.e. "\e[;123r" was parsed as "\e[123r"
|
| |
|
|
|
|
|
| |
mbrtowc() returns an unsigned. Need to cast to signed before checking
if less than zero.
This fixes an issue where invalid utf-8 sequences where treated as valid.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
| |
This reverts commit a575204bc77c711047740d2328d26043e8c976cb.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Remove the top-level state lookup table, which mapped from a state
enum to a state transition table, and replace it with a switch.
|
| |
|
|
|
|
|
|
|
|
| |
XTerm seems to ignore these when in UTF-8 mode. Since we _only_
support UTF-8, we don't need to recognize these control characters at
all.
However, it may be good to have them here for reference. So add them,
but commented out, along with their corresponding 7-bit
versions (which we _do_ recognize and implement).
|
| |
|
|
|
|
|
|
|
| |
When we insert an auto-newline, we must make sure we don't try to move
outside the terminal window.
This can for example happen when a scrolling region have been
configured, and the cursor is **outside** the scrolling
region (i.e. it's in the bottom margin).
|
| |
|
|
|
| |
When it did, we called print_insert() with that, which in turn
resulted in a too large size value passed to memmove.
|
| |
|
|
| |
This gets rid of spam when cat:ing binary data.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
In most states, most 8-bit values are no-ops. This is already handled;
action() recognizes ACTION_NONE as a no-op. Thus, all we need to do is
remove the assertion.
|
| |
|
|
| |
This reverts commit fd8a3992745b9ec51b6e6c1dfc39faf01369b680.
|
| | |
|
| |
|
|
|
|
|
| |
* It takes a parameter, that indicates the number of tab stops to move
through
* Use the tab stops defined in the tab stops list, not hard coded mod
8 columns.
|
| |
|
|
|
|
|
|
|
|
|
| |
There were actually two bugs here:
* When checking for a tab stop, make sure the new tab stop is at a
different column. Otherwise you can't tab away from a tab stop.
* When there aren't any tab stops configured, or when we're already
beyond the last tab stop, then tab to the last column (at least I
think that's what we're supposed to do).
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Instead of assuming hardcoded 8-width tab stops, use the tab stops
from the tab stop list.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Despite its name, it always moves down exactly one line.
|
| | |
|
| | |
|
| |
|
|
| |
It isn't used anywhere, even with LOG_ENABLE_DBG
|
| |
|
|
|
|
|
| |
In esc dispatch:
* Switch on private first, then final
* Recognize ESC #8 (DECALN), and implement it
|
| | |
|
| | |
|
| |
|
|
| |
cat:ing a binary file would otherwise result in us spamming syslog.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
... as this is done when a new OSC string is started
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The CLEAR action is so common, that explicitly clearing the entire
params array, which is kind of big, is too slow.
Clear it lazily instead. Meaning, we only set 'idx' (count) to 0 in
CLEAR. Then whenever we parse a parameter, clear the value and sub
parameters.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch takes a bit from the foreground color value in a
cell (todo: split up foreground/background into bitfields with a
separate field for 'foreground/background' has been set), and only
re-renders cells that aren't marked as clean.
Note: we use a 'clean' bit rather than a 'dirty' bit to make it easy
to erase cells - we can (keep doing) do that by simply memsetting a
cell range to 0.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
We now store the passthrough characters in a buffer, and call
dcs_passthrough() on unhook.
However, dcs_passthrough() doesn't do anything.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
However, we don't (yet) actually reset the terminal
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This enables switching between the G0 and G1 charsets.
|
| |
|
|
|
|
| |
We don't *have* to NULL-terminate the utf8 string. So don't. This
makes the cell glyph 4 bytes exactly, which is better for alignment
and cache usage.
|
| |
|
|
|
|
|
| |
'\ED' is just like '\n'; move the cursor down to the next row, or if
it's at the bottom, scroll up one row.
'\EE' is just like '\n\r'
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This commit also replaces the previous (temporary) key map with a much
more complete one.
|
| | |
|
| |
|
|
|
|
|
|
| |
This is strictly speaking not correct, since we're not treating a lot
of characters that should switch state as part of the OSC string.
The correct way would be to have a specific OSC UTF8 state that parses
UTF8 strings.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The grid is now represented with an array of row *pointers*. Each row
contains an array of cells (the row's columns).
The main point of having row pointers is we can now move rows around
almost for free.
This is useful when scrolling with scroll margins for example, where
we previously had to copy the lines in the margins. Now it's just a
matter of swapping two pointers.
|