You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In looking at #3734 I have been able to generate the correct encoded data. However I need a way to reliably and efficiently output it to the console.
Sixels can be output using Console.Write. Initially I added this as a bespoke thing in Driver i.e. part of the draw step after everything else was drawn. I only implemented it in NetDriver because that one was already using Console.Write so seemed easiest.
I added this to end of NetDriver.UpdateScreen
// Works with no flicker because it is the last thing in the draw step // (but code is suboptimal in terms of design and maintainability)foreach(var s in Application.Sixel){if(!string.IsNullOrWhiteSpace(s.SixelData)){
SetCursorPosition (s.ScreenPosition.X, s.ScreenPosition.Y);
Console.Write(s.SixelData);}}
But I think that was a mistake, instead I should try to 'work with' the driver rather than 'against it'.
Describe the solution you'd like
Rather than teaching Driver about sixel we should make it a view concern only, i.e. it should be possible to do something like the following:
voidSixelViewOnDrawContent(objectsender,DrawEventArgse){if(!string.IsNullOrWhiteSpace(_encodedSixelData)){// Does not work
Application.Driver?.Move (_screenLocationForSixel.X, _screenLocationForSixel.Y);
Application.Driver?.AddStr (_encodedSixelData);// Works in NetDriver but results in screen flicker when moving mouse but vanish instantly// Console.SetCursorPosition (_screenLocationForSixel.X, _screenLocationForSixel.Y);// Console.Write (_encodedSixelData);}}
The above code using Console.Write works but flickers as it fights with the Driver to render.
Sixel data is just string of text but does not work with Application.Driver.AddString, presumably because it is expecting to advance cursor etc and/or turn to Rune. What we want is just to output directly to the console stream at render time.
Maybe we can add a method like
Application.Driver.AddRaw(_encodedSixelData)
Describe alternatives you've considered
Would love to hear any ideas
The text was updated successfully, but these errors were encountered:
tznind
changed the title
Ability to output raw content data (e.g. sixel) directly via Application.Driver
Ability to output raw string content (e.g. sixel) directly via Application.Driver
Sep 28, 2024
Is your feature request related to a problem? Please describe.
In looking at #3734 I have been able to generate the correct encoded data. However I need a way to reliably and efficiently output it to the console.
Sixels can be output using
Console.Write
. Initially I added this as a bespoke thing in Driver i.e. part of the draw step after everything else was drawn. I only implemented it in NetDriver because that one was already usingConsole.Write
so seemed easiest.I added this to end of
NetDriver.UpdateScreen
But I think that was a mistake, instead I should try to 'work with' the driver rather than 'against it'.
Describe the solution you'd like
Rather than teaching Driver about sixel we should make it a view concern only, i.e. it should be possible to do something like the following:
The above code using
Console.Write
works but flickers as it fights with the Driver to render.Sixel data is just string of text but does not work with
Application.Driver.AddString
, presumably because it is expecting to advance cursor etc and/or turn toRune
. What we want is just to output directly to the console stream at render time.Maybe we can add a method like
Describe alternatives you've considered
Would love to hear any ideas
The text was updated successfully, but these errors were encountered: