Skip to content

Fixed(terminal-view): Draw text to the left of a sixel image on the same row - #5349

Open
dsvarela wants to merge 1 commit into
termux:masterfrom
dsvarela:fix/sixel-text-left-of-image
Open

dsvarela wants to merge 1 commit into
termux:masterfrom
dsvarela:fix/sixel-text-left-of-image

Conversation

@dsvarela

@dsvarela dsvarela commented Sep 28, 2026 •

Copy link
Copy Markdown

Follows #2973, cc @MatanZ.

In TerminalRenderer.render(), the branch for image cells discarded the pending text run, so text before an image on the same row was never drawn.
The change has four parts.

  • It draws the pending run before the image cell, with the guard and arguments of the normal style-change path.
  • It starts the next run at the cell after the image. column is already incremented at that point, so column + 1 started it one column late.
  • It advances currentCharIndex before it records lastRunStartIndex. The start index of the next run then matches its start column.
  • It resets lastRunInsideSelection with the other run state.

Testing

Tested on a Samsung SM-X806B with Android 16. The APK is a debug build of this branch (8629e63 plus this commit) from GitHub Actions on my fork. Only versionCode was changed for it, so that it installs over my existing build.
I ran:

printf 'LEFT '; magick -size 128x64 gradient:red-blue sixel:-; echo
  • Before (master): LEFT is drawn for a moment and disappears when the image appears.
    sixel-left-text-missing.jpg

  • After (this branch): LEFT stays on screen, with the image to its right at the same position as before.
    sixel-left-text-fixed.jpg

…ame row

The branch for image cells in TerminalRenderer.render() reset the pending
text run without drawing it, so text before an image on the same row was
not drawn. It also started the next run one column late. Draw the pending
run first, and start the next run at the cell after the image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant