Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to the limited tests I've done, the code seems to work fine. Theoretically, the performance shouldn't be affected at all, unless sixels are drawn. If they are, scrolling code will need to call memmove and memset for the part of the sixel_canvas where the images are drawn.
revscroll isn't implemented.
The sixel decoder has been extracted from https://github.com/saitoha/libsixel
The sixel needs to be drawn in a single call to flanterm_write. That means, the string passed should contain both starting
ESC
+Pp1;p2;p3;q
(which needs to be the very first thing in it) andESC
+\
at the end. After the closing escape sequence, the rest of the string is printed normally.If the requirement above is not met, the sixel will be outputed as a string.
Changes to the flanterm api:
malloc and free are no longer passed to flanterm_fb_init. Instead, they are declared as weak symbols that need to be defined by the user. This is because sixel.c needs to allocate memory outside flanterm_fb_init.
Those functions are called flanterm_fb_alloc(size) and flanterm_fb_free(ptr).
memmove has been added as a requirement.
I'm creating this pull request in hopes that it gets reviewed so I (or someone else who cares more) can improve it.