| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
| |
This fixes an issue where we resized+reflowed with bad rows/cols
values in the sixels.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
term_damage_cursor() damages the cell where the cursor is currently
at. This can be used to ensure the cursor is re-drawn, if there aren’t
any other pending updates.
term_damage_margins() requests the margins be redrawn the next time we
render the grid.
|
| |
|
|
|
| |
This option controls the initial state of the Alternate Scroll Mode,
and defaults to ‘enabled’.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
While pasting data from the clipboard, block *all* other data from
being sent to the client. This includes keyboard and mouse events, but
also replies for VT queries.
This is particularly important when bracketed paste has been enabled,
since then the client will interpret *everything* between the
bracketed paste start and end as paste data.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
When enabled, the mouse cursor is hidden when the user types in the
terminal. It is un-hidden when the user moves the mouse, or when the
window loses keyboard focus.
|
| |
|
|
|
|
|
|
| |
* Rename user_warning to user_notification
* Add warning and error types (in addition to the existing deprecated)
* Simplify logic when emitting a user notification after forking; we
don't need to copy the notification data since we're in a new
process and have total control over that memory.
|
| |
|
|
|
| |
This is intended to be used to print e.g. deprecation warnings inside
the terminal, *before* the shell is started.
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
And turn it from a boolean to an enum. It can be set to:
* `none` - disables the indicator
* `static` - always rendered near the top of the window
* `moving` - position reflects the scrollback position
|
| | | |
|
| |/
|
|
|
| |
FontConfig's DPI is a double, and using a float instead of an integer
results in higher resolution.
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Remove assertion that row be less than the scrolling region end. The
cursor may in fact be *inside* the margin.
Inside the margin, content never scrolls, but we must make sure we
don't move the cursor outside the grid.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
If not -1, spawn() will redirect the child's stdin/stdout/stderr to
these FDs.
|
| | | |
|
| |/
|
|
|
| |
These functions extract the current view, or the entire scrollback as
an UTF-8 encoded byte buffer.
|
| | |
|
| |
|
|
|
| |
And refactor: break out spacer-writing code to a function, since we do
exactly the same thing in two places.
|
| |
|
|
| |
Otherwise we end up overwriting the character in the last column
|
| |
|
|
|
|
| |
When printing a multi-column character, write CELL_MULT_COL_SPACER
instead of '0' to both padding cells (when character doesn't fit at
the end of the line), and to the cells following the actual character.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When printing a multi-column character at the end of the line, and it
doesn't fit, we currently insert a forced line-wrap. This means the
last character(s) on the previous line will be empty, followed by a
multi-column character in the first cell on the next line.
Without special code to handle this, the selection text extraction
code will insert a hard newline, since this is normally the correct
thing to do.
Add a TODO, to consider writing a special place holder value to these
padding cells.
|
| | |
|
| |
|
|
|
| |
We know we're within bounds, and thus we don't need the extra overhead
of term_cursor_right().
|
| | |
|
| |
|
|
|
|
| |
While this might seem like it would slow down things, it should in
fact help the compiler optimize: the "normal" code path, that prints
regular ASCII characters, always call term_print() with width == 1.
|
| |
|
|
|
| |
line-wrap is in the hot path, and term_cursor_down/left adds
additional checks that we don't need.
|
| | |
|
| |
|
|
|
| |
There's nothing wrong with using term_cursor_right(), but it is
unnecessary since we already check for the end-of-line.
|
| | |
|
| |
|
|
|
|
| |
LF should always clear LCF. Previously, it was done implicitly in
term_cursor_down(). I.e it was cleared as long as the cursor wasn't at
the bottom of the scrolling region
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of locking the queue for each dirty row we append, and
signaling a condition variable, just keep the lock while going through
the visible rows.
Release the lock once done.
Since we take the lock *before* posting the 'start' semaphore, all
workers will be waiting for the lock to be released.
Then, one at a time they'll get the lock and pick a row to
render. The queue will never get empty - when all rows have been
rendered, each worker will pick a 'frame done' "job" from the queue,
and break the rendering loop.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
There's one difference however, when we receive a kbd unfocus call,
*all* seats must have us unfocused before we actually change the
state.
|
| |
|
|
|
|
|
|
| |
* xcursor always set for all pointers
* xcursor sometimes not updated when it should be
* mouse grabbed state wasn't per seat, but global (i.e. "does at least
one seat enable mouse grabbing")
* selection enabled state wasn't per seat
|
| | |
|
| |
|
|
|
|
| |
That is, only call term_kbd_focus_in() if we're the *first* seat
focusing that terminal, and only call term_kbd_focus_out() if we're
the *last* seat that focused it.
|
| | |
|
| | |
|
| |
|
|
|
| |
Compiles and runs, but mouse, clipboard and other things have been
disabled.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When resizing the font on-the-fly, we now do a complete
font-reload (this is basically what fcft_size_adjust() did anyway).
To get the correct size, we maintain the current size ourselves.
We get the initial size from the user-provided font pattern, by
converting the string to an FcPattern, and using FcPatternGet() to
retrieve both the FC_SIZE and FC_PIXEL_SIZE attributes. These
attributes are then removed from the pattern, and the pattern is
converted back to a string.
The terminal struct maintains a copy of the font sizes. These are
initially set to the sizes from the config.
When the user resizes the font, the terminal-local sizes are
adjusted. To ensure the primary and user-configured fallback fonts are
resizes equally much, convert any pixel sizes to point sizes at this
point.
When the font size is reset, we reload the font sizes from the
config (thus once again returning actual pixel-sizes, if that's what
the user has configured).
|
| |
|
|
|
| |
This option controls whether the default cursor should blink or
not. The default is to *not* blink.
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
If changing the font size causes the cell size to decrease, either
horizontally or vertically (or both), then delete all sixels since the
grid space they allocated no longer is enough to hold the images.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The logic that breaks out of sixel loops does not work for rows that
has already wrapped around.
Thus, we need to destroy sixels that are about to be scrolled
out *before* we actually scroll.
Since this is the *only* time we destroy sixels (instead of
overwriting it), rename the sixel functions. And, since they now do a
very specific thing, they can be greatly simplified (and thus faster).
|
| |/
|
|
| |
This is necessary to handle multi-column characters correctly.
|
| | |
|
| | |
|
| |
|
|
| |
Avoid unnecessary wrap checks if the sixel image list is empty.
|
| |
|
|
|
|
|
|
|
|
| |
Instead of completely erasing a sixel image when it is being
"overwritten" (text is printed somewhere within the image, or another
sixel image is emitted within the first image), split it up into up to
four pieces: 'above', 'below', 'to-the-left' and 'to-the-right'.
This is currently very un-optimized, but seems to produce correct
results.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
A client can re-use the palette between images. Resetting the palette
breaks this.
Now we initialize the palette on demand, and resets it when the
palette size is changed (by the client).
|
| | |
|
| |
|
|
|
|
|
|
| |
Since foot is pretty aggressive about spawning the client early, it
was possible for a fast client to read a 0x0 terminal size. Not all
clients coped well.
Closes #20.
|
| |
|
|
|
| |
Instead, register their PIDs with the new reaper module and let it
handle them.
|
| |
|
|
|
| |
When the viewport wraps around, the selection points may be
"incorrect".
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When scrolling, there are a couple of cases where an existing
selection must be canceled because we cannot meaningfully represent it
after scrolling.
These are when the selection is (partly) inside:
* The top scrolling region
* The bottom scrolling region
* The new lines scrolled in. I.e. re-used lines
For the scrolling regions, the real problem is when the selection
crosses the scrolling region boundary; a selection that is completely
inside a scrolling regions _might_ be possible to keep, but we would
need to translate the selection coordinates to the new scrolling
region lines.
For simplicity, we cancel the selection if it touches the scrolling
region. Period.
The last item, newly scrolled in lines is when the selection covers
very old lines and we're now wrapping around the scrollback history.
Then there's a fourth problem case: when the user has started a
selection, but hasn't yet moved the cursor. In this case, we have no
end point.
What's more problematic is that when the user (after scrolling) moves
the cursor, we try to create a huge selection that covers mostly
empty (NULL) rows, causing us to crash.
This can happen e.g. when reverse scrolling in such a way that we wrap
around the scrollback history.
The actual viewport in this case is something like `-n - m`. But the
selection we'll end up trying to create will be `m - (rows - n)`. This
range may very well contain NULL rows.
To deal with this, we simply cancel the selection.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We normally don't clear the selection when scrolling. The exception is
when the selection covers re-used rows. I.e. rows that we scroll in
and clear.
In this case we cancel the selection (we _could_ modify it and keep as
much as possible and only remove the re-used rows...). We must do
this *before* scrolling, since scrolling will swap rows (when there's
a scrolling region). When this happens, the selection is "corrupted",
and canceling it afterwards will not work.
|
| |
|
|
|
| |
This allows us to check the selection once when scrolling, instead of
once for each scrolled in line.
|
| |
|
|
|
|
|
| |
This reverts commit 8448296bb3c0fa96f5af5cb7ec563bb0c7e99093.
Applications need to be multi-column character aware anyway, and they
should deal with this.
|
| | |
|
| |
|
|
|
| |
This can happen when there's an error instantiating the
terminal *after* we've spawned the slave process.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* Detect thrd_create() failures in all places where we instantiate
threads
* Log error correctl; thrd_create() does not return an errno value
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of storing combining data per cell, realize that most
combinations are re-occurring and that there's lots of available space
left in the unicode range, and store seen base+combining combinations
chains in a per-terminal array.
When we encounter a combining character, we first try to pre-compose,
like before. If that fails, we then search for the current
base+combining combo in the list of previously seen combinations. If
not found there either, we allocate a new combo and add it to the
list. Regardless, the result is an index into this array. We store
this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell.
When rendering, we need to check if the cell character is a plain
character, or if it's a composed character (identified by checking if
the cell character is >= COMB_CHARS_LO).
Then we render the grapheme pretty much like before.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We only used utf8proc to try to pre-compose a glyph from a base and
combining character.
We can do this ourselves by using a pre-compiled table of valid
pre-compositions. This table isn't _that_ big, and binary searching it
is fast.
That is, for a very small amount of code, and not too much extra RO
data, we can get rid of the utf8proc dependency.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is basically just a loop that renders additional glyphs on top
off the base glyph.
Since we now need access to the row struct, for the combining
characters, the function prototype for 'render_cell()' has changed.
When rendering the combining characters we also need to deal with
broken fonts; some fonts use positive offsets (as if the combining
character was a regular character), while others use a negative
offset (to be used as if you had already advanced the pen position).
We handle both - a positive offset is rendered just like a regular
glyph. When we see a negative offset we simply add the width of a cell
first.
|
| |
|
|
|
|
|
|
|
|
|
| |
This is the *only* place combining characters are reset. In
particular, we do *not* reset them in a normal cell erase.
This is a performance design decision - clearing the combining
characters in erase is way too slow.
This way, we clear it only when we *have* to. Anything looking at the
combining characters must first ensure the base character is not 0.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The way things works right now, we cannot enable the ptmx FDM callback
right away. We need to wait for the Wayland window to have been
configured.
Before the window is configured, we don't have a size, and no
grid. Thus, if we try to process ptmx data we'll crash since we have
no where to write it to.
So, registering the ptmx fd with the FDM is now delayed until we've
received the first 'configure' event from Wayland.
|
| |
|
|
|
| |
This allows the client to load in parallel with our font loading,
which should improve startup time.
|
| | |
|
| |
|
|
|
| |
We sort of already did this. However, we did not handle the case where
the thread array itself hadn't yet been allocated.
|
| |
|
|
|
|
| |
This ensures the resources (e.g. stack) used by the transient threads
used to load the primary fonts can be re-used by the rendering worker
threads.
|