Terminal.Gui icon indicating copy to clipboard operation
Terminal.Gui copied to clipboard

Terminal image support (Kitty graphics protocol, Sixel, etc)

Open rsmirnov90 opened this issue 1 year ago • 7 comments

Has anyone considered adding support for rendering an image in the text terminal?

I can think of many scenarios where this could come in useful, and would love to work on something like this myself though I likely wouldn't even know where to start.

rsmirnov90 avatar Nov 21 '23 06:11 rsmirnov90

There has been consideration but never more than that.

See this discussion for example (which contains link to example code): https://github.com/gui-cs/Terminal.Gui/discussions/1265

If you are motivated to give it a go then the best place to start would probably be getting a standalone console app to produce a sixel image. Then we can help integrate it into the driver layer or a View.

tznind avatar Nov 21 '23 08:11 tznind

FYI, VT support has recently been much improved in Windows Terminal/ConPTY, and Sixel is now working in Windows Terminal (Canary only for now)! See https://github.com/microsoft/terminal/pull/17510 and https://github.com/microsoft/terminal/pull/17581

I grabbed https://github.com/gnachman/libsixel-1/blob/master/images/snake.six and got this:

image

Nutzzz avatar Aug 09 '24 19:08 Nutzzz

It's necessary install Sixel?

BDisp avatar Aug 09 '24 20:08 BDisp

It's necessary install Sixel?

For the above test, nothing to install was necessary (other than WT Canary). It worked in both PowerShell and cmd.

Nutzzz avatar Aug 10 '24 04:08 Nutzzz

My WT doesn't show anything about Canary in the version.

BDisp avatar Aug 10 '24 07:08 BDisp

Here is a link to the blog post, which contains a link to GitHub repo including installers

https://devblogs.microsoft.com/commandline/introducing-windows-terminal-canary/

Presume canary is just the 'early adopter' channel. So this feature will come later to Windows Terminal core releases too.

tznind avatar Aug 10 '24 08:08 tznind

Presume canary is just the 'early adopter' channel. So this feature will come later to Windows Terminal core releases too.

Correct (the canary refers to the "coalmine" adage). You can download the latest Canary installer here: https://aka.ms/terminal-canary-installer or just wait until the end of the month (estimated) to update your WT from the Microsoft Store.

Nutzzz avatar Aug 10 '24 18:08 Nutzzz