-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Application synchronized updates / DECRQM #1582
Comments
Would if I could, but I'm not a member... |
I don't know how much of the thread on terminal-wg you've read, but note that the DCS sequence that was originally proposed is somewhat problematic, in that it produces garbage output on some terminals that don't recognise DCS, so it's not really safe to use by default. As a result it was generally agreed that a DECSET private mode sequence would be preferable. That way you can use the sequence indiscriminately, and worst case it will be ignored on terminals that don't support it. The proposed mode sequences are as follows:
|
thanks for the tip, @j4james ! |
I just came here as I wanted to see if notcurses does or will support that. I am currently trying to gather a list of terminals / toolkits / apps that do support it. And I hoped to be able to add you soon, too. Just to let you know, @dankamongmen :) |
yeah @christianparpart i'm intending to support it. reading over the spec more closely now (i'd just seen a summary, and liked the idea). oooh, i don't like this timeout business one bit =[ |
most interesting to me would be using this to ensure graphic+text updates are performed at the same time (i would use it around each frame i draw, but the main benefit would be eliminating flicker in graphic+text cases). i don't see anything regarding graphics at https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec. what's the story there? |
so i'm taking a look at this spec, and it's not...necessarily what i would have done. a few thoughts:
i'd hope that when a terminal reads a frame in toto, the display is effectively automatic, at least most of the time. so i'm thinking i maybe only want to use this on frames larger than some size, with that size ideally being "the number of bytes that the terminal is prepared to display automatically" (which of course might not be defined). i mean, plenty of apps may very well be changing a single cell and redrawing. that would currently map to a 2-byte frame in Notcurses. if i throw this around every frame, that's 700% overhead for a totally common case. erp! |
i mean i guess this is already implemented in a number of things, but here's what i would have liked:
that at least cuts the overhead. oh well. maybe this wouldn't work for reasons i don't understand. |
maybe i'll use this around any rasterization that involves a graphic. that's gonna be big enough that the overhead is a wash, and that's where i need it, anyway. |
Hey, i answer one question/concern for now and at that time of the day: fear not the discoverability. Use DECRQM to do that and the reply (https://vt100.net/docs/vt510-rm/DECRPM.html) will tell you also if it is supported. On the latency: i would recommend using this not for one byte updates. It is rather intended for full screen / bigger updates to protect against tearing. On timeout: the TE should have one, should not be configurable, should be reasonable (i e. not too big). I don't see why other people liked to talk that to death, well yeah. :) If a TE has a too short timeout (or the line was too slow) the worst that can happen is that the flush (draw) happens earlier, and that's not worse than without, in the worst case. Only visual changes are affected by this. So soft/hard reset etc can still have a direct effect. I like to compare that to GPU programming where you swap the buffer to render a new frame. This is similar: the rendering is deferred to a tactically better fitting later point in order to avoid tearing. I hope all these arguments where convincing :) I like to start counting at negative 3 instead 1. |
I should mention DECRQM/DECRPM in the linked document. Thanks for pointing that out. |
i've gone ahead and created the |
I'd just like to take the opportunity to chime in with everything @christianparpart said. Not that I have seen much tearing with notcurses anyway - testimony of nicely done optimizations! |
it is true that i track emitted bytes and spent seconds with some fanaticism. with that said, it's easy to see problems when you're mixing overlapping text and graphics over an ssh session. |
Let's add a stat for this -- at the very least, I want to see how many times we used it across a given context's lifetime. I think for a first try, I'm going to use this whenever we have an output burst of 8KB or more (maybe use we of course won't know the output size until after putting together the output, so this will cost us one extra a Kitty so those kitty frames are surely being dragged high by the gigantic RGBA frames. 8192 looks decent. |
Everything larger that kernel page size i would recommend to frame using this technique.
write() exists to reduce the context switches of too many consecutive write() calls. Context switches on Linux aren't that expensive anymore since many years though. So it may make sense to do the buffer stitching client side if the individual chunks are not too large (> kernel page size) |
yep, my conclusion as well. i expect this initial implementation to go in tonight. |
@christianparpart i cannot for the life of me get contour to reply to any DECRQMs. kitty does just fine:
but contour never seems to reply:
any idea what i'm missing here? |
@dankamongmen i found my culprit. I stubbed the impl of DECRQM. I will implement that tonight. Expect it on master asap (and sorry for being disappointed |
i contemplated a header off my terrace for some hours, i assure you |
i'm thinking this will be the last big thing to go into 2.3.5. |
@christianparpart maybe i'm missing something, but oughtn't you have a '?' in here following the CSI? here's what i see in response from contour at the moment:
|
And the best of all is, that the test cases did pass, because they were
missing it too. I refactored it correctly into the wrong way. Many thanks
(already fixed) :-)
Am Di., 22. Juni 2021 um 18:54 Uhr schrieb Nick Black <
***@***.***>:
… @christianparpart <https://github.com/christianparpart> maybe i'm missing
something, but oughtn't you have a '?' in here following the CSI? here's
what i see in response from contour at the moment:
state: 0 char: 27 1b
state: 1 char: [ 91 5b
state: 2 char: 2 50 32 <----------------- shouldn't there be a qmark here
state: 2 char: 0 48 30
state: 2 char: 2 50 32
state: 2 char: 6 54 36
state: 2 char: ; 59 3b
state: 2 char: 2 50 32
state: 2 char: $ 36 24
state: 2 char: y 121 79
Reporting DEC Modes
CSI
9/11 ? <--------------------------------------------
3/15 Pd
3/n ;
3/11 Ps
3/n $
2/4 y
7/9
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1582 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAN3O2MVY2G5XYNDKZ2DG3TUC53ZANCNFSM43MDU24A>
.
|
notcurses is now detecting App-Synchronized Update support in
|
now we just need hook it up to the rasterizer. when is everyone expected to move to $2026? |
we're now sending ASUs when support is detected, and frames are sufficiently large. |
Tested the |
was this with foot? because foot is (at least for me) replying with |
Now that i fixed my freaking brain damagei think you have it working on contour as well, right?
This is now not just a single TE spring 2026. So it does make sense for the rest to hop on and drop the DCS. What about pinging libvte on that matter? |
yes, it is working in contour. it is not working in foot because foot is replying with a |
Foot has supported app sync:ed updates since forever. But, (and yes, there'll be a 1.8 release very soon) |
cool, i'll leave this as it stands, then. i thought i tested with current git as well. maybe not! i don't intend to support the old query, so i'll drive ASUs with foot wherever 2026 is supported. |
spun up weston today with the freshest |
oh man this is like playing on easy |
This will conceal the following message: erresc: unknown private set/reset mode 2026 See also: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/2#note_579597 microsoft/terminal#8331 dankamongmen/notcurses#1582 xtermjs/xterm.js#3375 kovidgoyal/kitty@5768c54 https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/2 (seen in the
foot
man page). hey @dnkl if you could invite me into that terminal-wg, i'd appreciate it.The text was updated successfully, but these errors were encountered: