Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure a common cursor position after printing a sixel in direct mode #1747

Closed
db48x opened this issue Jun 10, 2021 · 15 comments
Closed

ensure a common cursor position after printing a sixel in direct mode #1747

db48x opened this issue Jun 10, 2021 · 15 comments
Assignees
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) enhancement New feature or request hax0rs-wanted looking to hack on notcurses? try these
Milestone

Comments

@db48x
Copy link
Contributor

db48x commented Jun 10, 2021

It looks like xterm leaves the cursor at the last line of the image, one past the last column, while Alacritty leaves it on the first column of the line after the image.

It sure would be nice if notcurses abstracted this difference away. :)

@db48x db48x added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 10, 2021
@db48x
Copy link
Contributor Author

db48x commented Jun 10, 2021

Or possibly xterm leaves the cursor at the first column of the last line of the image? Perhaps it depends on where the sixel cursor ends up…

And I have no idea what the VT340 did.

@dankamongmen
Copy link
Owner

and mlterm makes it visible, for unfathomable reasons! thanks for the heads-up, definitely a Notcurses job (if not a particularly exciting one).

@dankamongmen dankamongmen self-assigned this Jun 10, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Jun 10, 2021
@dankamongmen dankamongmen added bitmaps bitmapped graphics (sixel, kitty, mmap) and removed documentation Improvements or additions to documentation labels Jun 10, 2021
@dankamongmen
Copy link
Owner

one thing i need go look at all subject terminals about is how they update the cursor (and for that matter draw the graphic) when in RTL orientation. IMHO, if you're going RTL, you ought draw your image RTL as well, and place the cursor to the left of it when done. i doubt this is done anywhere.

if you're using Qudum Mongγol bičig and writing top to bottom, i assume you're accustomed to nothing working, ever.

@dankamongmen dankamongmen added the hax0rs-wanted looking to hack on notcurses? try these label Jun 10, 2021
@dankamongmen
Copy link
Owner

just as a note to myself, this doesn't matter in rendered mode, since we always do a hard cursor move there.

you know, maybe we ought do the same thing in direct mode, which would allows us to remove the leaky abstraction plumbing C=1 through to kitty_blit(). we just have to be able to know where the cursor ought be. were we to do yet another terminal-specific grotesque hack here, it ought be a mere matter of moving the cursor back with alacritty.

this actually kinda sucks, though, because if alacritty is moving the cursor down below the graphic, they're also presumably scrolling if we blit to the last line. blargh.

the issue here might be more one of alacritty not honoring 8452:

Ps = 8 4 5 2 ⇒ Sixel scrolling leaves cursor to right of graphic.

yeah, i kinda think that alacritty is failing to honor 8452 here. i'll file a bug against them.

given that the sixel code still(!) has not been merged in alacritty, i don't see any need to put in code to differentiate and handle older versions of alacritty -- if we can get this fixed, it'll be present from day 1 of their sixel support. you agree with all this, @db48x?

@dankamongmen
Copy link
Owner

hrmmm, we get the same results in ncplayer -k between xterm and alacritty

@db48x
Copy link
Contributor Author

db48x commented Jun 11, 2021

That is an excellent point; I hadn’t considered that. I’ve just now tried implementing this in Alacritty, with some success:

Screenshot from 2021-06-11 01-29-30

Perhaps after a little 8–hour nap I will be able to figure out why it stayed on the correct line but reset to the first column even though I told it not to.

@db48x
Copy link
Contributor Author

db48x commented Jun 11, 2021

Nevermind:

Screenshot from 2021-06-11 01-39-32

@dankamongmen
Copy link
Owner

i intend to get to this soon, definitely in the 2.3.x cycle, but probably not within the next week. i'm considering it lower priority than some other things due to the existence of a workaround (unconditional postblit positioning of the cursor). if that's giving you any kind of problem, due perhaps to an inability to reliably determine the desired cursor position, please let me know and i'll bump up the priority.

@db48x
Copy link
Contributor Author

db48x commented Jun 14, 2021

I made a merge request for Alacritty, so hopefully there will be few special cases.

@dankamongmen
Copy link
Owner

awesome

@dankamongmen
Copy link
Owner

i just posted "why haven't they merged your good shit yet?" in the alacritty issue, because i'm a goddamned moron, though my question still stands.

this is currently breaking video playing with ncdirect_stream() on alacritty when the video does not stretch across the width of the screen, e.g. ncplayer -k -bpixel -snone ../data/fm6.wmv in alacritty.

@dankamongmen
Copy link
Owner

@db48x , just wanted to let you know that direct mode is likely to be weakly deprecated, in the sense that i'm not going to be putting effort into it going forward, and new code ought be written to use "cli mode". this latter is just the main Notcurses API together with some flags plus a scrolling standard plane. direct mode will continue to be supported through at least Notcurses IV.

bugfixes like this will still happen where necessary.

@dankamongmen
Copy link
Owner

i think commit 34869d3 might have just resolved this.

@dankamongmen
Copy link
Owner

i know that in growlight-readline in kitty, running the version command, we see the following:

2021-10-04-023052_1585x1057_scrot

@dankamongmen
Copy link
Owner

the behavior above no longer occurs in any emulator i can find to test with. i think we're good here now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) enhancement New feature or request hax0rs-wanted looking to hack on notcurses? try these
Projects
None yet
Development

No branches or pull requests

2 participants