Open lapsio opened 3 years ago
@lapsio Post an example, please.
So for Ponysay it doesn't do much difference whether you run it from TTY or graphical terminal. It emulates colors by swapping palette on the go, while terminal-kit doesn't work all that well with TTY:
I assume ponysay does that by swapping palette because after displaying pony by ponysay in TTY shell colors (like red or green) are left altered and basically whole terminal palette is screwed and mimics ponysay graphic color shades. So for example if ponysay displays red pony then red displayed by red color code in shell (\u001b[31m) is different than default red and it changes after each ponysay execution.
also sorry for extremely late response
@lapsio Ok, but have you an example of actual code using Terminal-Kit that doesn't work? Also are you talking about you the Linux console? Last time I checked, it was not supporting 256 colors, only 16 colors.
If your last image was produced by the lib, it's clear that it was expecting 16 or even 8 colors.
yeah all 3 images are produced in TTY with TERM env equal to "linux".
Code is fairly simple:
#!/usr/bin/node
term = require('/usr/lib/node_modules/terminal-kit');
process.argv.slice(2).forEach(i=>term.terminal.drawImage(i,{shrink:{ width: term.terminal.width, height: term.terminal.height * 2 }}))
first two photos were ponysay graphics, last one is terminal-kit.
When I'm trying to display image in TTY all colors are really wonky. I know it's tricky to display 256 color images in TTY but for example
ponysay
does manage to do that by swapping palette on the go. Would it be possible to achieve something similar with terminal-kit?