mirror of
https://github.com/xcat2/confluent.git
synced 2026-01-11 02:22:31 +00:00
It turns out that specifying height and width explicitly does not guarantee that the image protocols will actually fill the specified space. Notably iterm will honor aspect ratio (which is good), but leave the cursor where the image would naturally leave it (which is difficult with relative positioning). Previously, relative positioning was used as a workaround for the fact that save/restore or any absolute positioning may be fouled by incurring scroll. To make cursor save/restore work, we determine the total rows and print newlines enough to incur scroll and then move cursor back up. This lets us use save/restore to ignore cursor movement by the image.