How about running resize in both terminal and conhost? #2735

Open
opened 2026-01-30 23:03:36 +00:00 by claunia · 0 comments
Owner

Originally created by @mcpiroman on GitHub (Jul 12, 2019).

I commented about this on #1465, but this may deserve an issue (for PR, to have separate discussion).

My best bet to fix or at least simplify this [#1465] is to not emit new resized buffer from conhost, but instead run the resize on terminall's buffer too. This way both buffers should be the same and additionally terminal will have access to context of the resize, which would e.g. enable us to track selection transform (#1368), and maybe to fix the bugs above too.

It should be at least as (in)efficient as it is now (especially over network), because despite doubled work, conhost wouldn't need to transfer the buffer back to terminal, which seems comparatively costly.

It could eventually be futher optimizied so thet when user drags window the resize runs only on terminal's buffer and is reported to conhost only when the user releases LMB (but this would reqiure to freeze sth like the conhost does when scrolling?).

And since you want to support existing 3-party terminals - they handle resize themselfs. So while the present solution should work, it will be unusual to them and may cause some troubles such as we have now (even if we resolve them on terminal side).

And finally, in passthrough mode terminal would have to resize the buffer itself.

How are you about that?

Originally created by @mcpiroman on GitHub (Jul 12, 2019). I [commented](https://github.com/microsoft/terminal/issues/1465#issuecomment-508433534) about this on #1465, but this may deserve an issue (for PR, to have separate discussion). > My best bet to fix or at least simplify this [#1465] is to not emit new resized buffer from conhost, but instead run the resize on terminall's buffer too. This way both buffers should be the same and additionally terminal will have access to context of the resize, which would e.g. enable us to track selection transform (#1368), and maybe to fix the bugs above too. > > It should be at least as (in)efficient as it is now (especially over network), because despite doubled work, conhost wouldn't need to transfer the buffer back to terminal, which seems comparatively costly. > > It could eventually be futher optimizied so thet when user drags window the resize runs only on terminal's buffer and is reported to conhost only when the user releases LMB (but this would reqiure to freeze sth like the conhost does when scrolling?). > > And since you want to support existing 3-party terminals - they handle resize themselfs. So while the present solution should work, it will be unusual to them and may cause some troubles such as we have now (even if we resolve them on terminal side). > > And finally, in passthrough mode terminal would have to resize the buffer itself. How are you about that?
claunia added the Needs-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-30 23:03:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2735