Supercharged graphics. #1265
migueldeicaza
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
What about allowing escape sequences, maybe something like this ...
// windowsdriver
GetConsoleMode (OutputHandle, out var v);
SetConsoleMode (OutputHandle, v | 4);
...
public override void AddRune (Rune rune, bool ansi = false)
{
rune = MakePrintable (rune, ansi);
...
}
public override void AddStr (ustring str, bool ansi = false)
{
foreach (var rune in str)
AddRune (rune, ansi);
}
...
public static Rune MakePrintable (Rune c, bool ansi = false)
{
if (c == 0x1B && ansi) return c;
...
} Then we can do more colorful controls/views. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Latest Preview release of Windows Terminal seems to support sixels too:
static void Main(string[] args)
{
Console.Clear();
Console.WriteLine("Yay sixels");
// Hard-coded sixel content
string sixelContent = "\u001bP0;0;0q\"1;1;60;23#0;2;0;0;0#1;2;99;36;0#2;2;96;40;0#3;2;98;39;0#4;2;95;42;0#5;2;93;46;0#6;2;91;50;0#7;2;92;49;0#8;2;94;44;0#9;2;0;100;7#10;2;87;56;0#11;2;86;58;0#12;2;84;61;0#13;2;85;60;0#14;2;90;52;0#15;2;91;50;0#16;2;88;54;0#17;2;81;65;0#18;2;80;67;0#19;2;82;64;0#20;2;78;71;0#21;2;79;70;0#22;2;76;74;0#23;2;75;76;0#24;2;75;76;0#25;2;75;76;0#26;2;73;78;0#27;2;73;78;0#28;2;74;77;0#29;2;74;77;0#30;2;74;77;0#31;2;75;77;0#32;2;74;78;0#33;2;74;78;0#34;2;74;77;0#35;2;72;80;0#36;2;71;81;0#37;2;72;81;0#38;2;71;81;0#39;2;72;81;0#40;2;73;78;0#41;2;73;78;0#42;2;73;79;0#43;2;73;79;0#44;2;73;80;0#45;2;73;79;0#46;2;72;80;0#47;2;73;80;0#48;2;72;80;0#49;2;73;79;0#50;2;69;85;0#51;2;68;86;0#52;2;69;86;0#53;2;68;86;0#54;2;69;86;0#55;2;68;87;0#56;2;68;87;0#57;2;68;87;0#58;2;68;87;0#59;2;68;87;0#60;2;71;82;0#61;2;71;82;0#62;2;71;82;0#63;2;71;82;0#64;2;71;82;0#65;2;71;83;0#66;2;70;83;0#67;2;70;84;0#68;2;69;84;0#69;2;70;84;0#70;2;70;84;0#71;2;70;84;0#72;2;71;83;0#73;2;71;83;0#74;2;69;85;0#75;2;69;85;0#76;2;69;85;0#77;2;70;85;0#78;2;69;85;0#79;2;69;86;0#80;2;69;85;0#81;2;62;96;0#82;2;62;96;0#83;2;62;96;0#84;2;62;97;0#85;2;62;97;0#86;2;62;96;0#87;2;61;98;0#88;2;62;97;0#89;2;61;98;0#90;2;62;98;0#91;2;62;97;0#92;2;61;98;0#93;2;62;98;0#94;2;61;98;0#95;2;60;99;0#96;2;61;99;0#97;2;60;99;0#98;2;61;99;0#99;2;60;100;0#100;2;60;100;0#101;2;60;100;0#102;2;62;98;0#103;2;65;90;0#104;2;67;88;0#105;2;67;89;0#106;2;67;89;0#107;2;67;89;0#108;2;67;89;0#109;2;67;88;0#110;2;68;88;0#111;2;67;88;0#112;2;66;89;0#113;2;66;90;0#114;2;66;90;0#115;2;67;89;0#116;2;66;90;0#117;2;66;90;0#118;2;66;91;0#119;2;67;89;0#120;2;65;91;0#121;2;65;91;0#122;2;65;92;0#123;2;65;92;0#124;2;64;93;0#125;2;64;94;0#126;2;64;94;0#127;2;64;93;0#128;2;65;93;0#129;2;64;93;0#130;2;64;93;0#131;2;65;92;0#132;2;66;91;0#133;2;63;95;0#134;2;64;94;0#135;2;64;94;0#136;2;64;95;0#137;2;63;95;0#138;2;63;95;0#139;2;63;95;0#140;2;64;95;0#141;2;63;96;0#142;2;63;96;0#143;2;64;95;0#144;2;75;75;0#4~{w#7??B^}o#14F^_#10BFo_#13F~o#19?BN{#0{Ez|llJ}KsSsKw#37@FW#70BEw_#107?@Mo#121B]w#135@Mw#88BMo_$#8?BCo#6???@#15Nw_#16^{w#11N^w#12?N~{o#17BB#9wCAQQs?oGGGo#45F{o#65F{_#55?@Fw_#132?C#129@Co#141@Eo#87@#98N^~~$#5??BN~{_#18!17?@#22!5?@BB_#32B#26B#48?AG_#74?@F[o#110EO#120??_#124BMo#83@Ko$#23!33?B#72!7?W#52?AG#112?@Nw-#4@F^~w#5FN{o#15?F]o#16N~[_#13?D~w_#19@?{wo#18?Gw_#20Gw#22www_#32Fo_#37DMo#72C_#52@W_#110G_#121@Nw_#83?@^w_$#2EW_#8?Fwo#7BN~w_#10???b]o#12??F^}{#9@@AAAB?@AAA@#23[w#45F]o#65@Mo#74B]_#107@FWo#129?FW_#88??F[_$#3w_#14!9?@No#11??@Ny#0!4?BAEDDDCFEDDDEB#26?G#48@Io#70@J[_#55F]o#112FMo#135?BN}_#87?AO$#17!26?Gwo#21?Wo#124!21?CO#98???@N-#0MIyAyYmggWowGggwGgggGggG}I}wGgggWgggGw}A}??wKuyYYU{wGw?wG}I}$#1o_#4?@@@#8@A#7?@FFE#14?BE#10?BF#11F#13FFC#19?@@@C#18?@F#21FC#22?BFFE#23@#32@?o#37AA#70?@#74@@#55@#110@#107BE#121@F}#124@#135F#141@#83@#88@$#3@O#5!5?DFEG#15?@FC#16@FC#12!4?BF#17???BFE#20??BFC#144??@#45??@Nw#65@B#112!6?@C#129?@E$#9?CC{CcOOO_??oOO?oOOOoOOo?s??oOOO_OOOo??{!4?oGCccg??o???o?s$#2?@@#48!39?DC#120!8?A-#1^^OO#3OO#2O#4OOO#8O#5OO#7O^O#15O#14OO#10??O#11OO#13OO#12OOO#19OWO#18?OO#21O#20OO#22OOO#23O#32O#26O#45WO#48O#65OO#70O#74OO#55O#110O#112@O#121OO#129O#135O$#0??NGNK!4INNGN?NGN?NGNNGNGNNGN?NGGIIGNNGNNHNCLJJJGNFKJIJGNGN$#9???F?B!4D??F???F???F??F?F??F???FFDDF??F??E?BACCCF??BCCCF?F$#16!18?NOO#17!9?F?O#52!18?G#107??O-\u001b\\";
// Output the sixel content to the console
Console.Write(sixelContent);
Console.Read();
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This might be difficult to test on Windows today, but on MacOS, iTerm2 and SwiftTerm both have support for Sixel graphics as well as iTerm2-styled graphics.
While drivers like curses could not support it, it would be possible to send a direct escape sequence and then the image contents, details on what needs to be sent is here:
https://iterm2.com/documentation-images.html
This could be used both for the charting controls, but also for an image view.
Beta Was this translation helpful? Give feedback.
All reactions