Display graphical images in terminal #7944

Open
opened 2026-01-31 01:16:28 +00:00 by claunia · 30 comments
Owner

Originally created by @JekRock on GitHub (May 5, 2020).

Description of the new feature/enhancement

It would be nice to have the ability to display graphical images in the terminal by using the API provided by the Windows Terminal. Maybe something similar to https://sw.kovidgoyal.net/kitty/kittens/icat.html or https://www.iterm2.com/documentation-images.html

Originally created by @JekRock on GitHub (May 5, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement It would be nice to have the ability to display graphical images in the terminal by using the API provided by the Windows Terminal. Maybe something similar to https://sw.kovidgoyal.net/kitty/kittens/icat.html or https://www.iterm2.com/documentation-images.html <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). -->
claunia added the Issue-FeatureHelp WantedProduct-TerminalArea-TerminalControl labels 2026-01-31 01:16:29 +00:00
Author
Owner

@zadjii-msft commented on GitHub (May 5, 2020):

So we've already got #448 for display images with sixel graphics, though maybe this issue would make sense to leave open for supporting other binary image formats in the Terminal. Especially for something like gifs, which I don't think sixel is necessarily well suited for.

@zadjii-msft commented on GitHub (May 5, 2020): So we've already got #448 for display images with sixel graphics, though maybe this issue would make sense to leave open for supporting other binary image formats in the Terminal. Especially for something like gifs, which I don't think sixel is necessarily well suited for.
Author
Owner

@DHowett-MSFT commented on GitHub (May 11, 2020):

I'm taking triage off this. It needs a spec, and we need to make sure that we follow the prevailing standards if we're ever going to do this.

@DHowett-MSFT commented on GitHub (May 11, 2020): I'm taking triage off this. It needs a spec, and we need to make sure that we follow the prevailing standards if we're ever going to do this.
Author
Owner

@DHowett-MSFT commented on GitHub (May 11, 2020):

Comments from #4544.

from @zyy1998

Display images in terminal

I'm trying to use WSL to substitute some functions on windows, it performed well in some text-only functions. But I'm also want to use ranger ( a linux terminal file explorer ) to replace totalcommander which I often used or even windows file explorer, ranger satisfies my content in many occasions but for image preview.

w3m is a terminal web browser that could be used to display images in terminal, and it can also be used by ranger. However, w3m didn't work on this terminal.

There are many other terminals like iTerm2urxvt and alacritty could display images. As a terminal under windows, I think it's more necessary to support this feature.

Proposed technical implementation details

I don't know how does w3m works, but I have noticed that the terminal could be changed the background pictures, so if you want to render some images, you can just change the specific area of the background of the terminal. Actually it's how urxvt handled it.

Of course, you don't have to support w3m, just do something that could display images correctly and the method could be called by other apps like ranger, that's all what I need.

Thanks! ( And pardon for my poor English😁 )

You can find more information here: https://github.com/ranger/ranger/wiki/Image-Previews

from @akho

w3m and überzug both rely on x11 to draw an image in a subwindow. It is highly unlikely that either of the two can be made to work in Terminal without also modifying the tools themselves.

Having some way to draw images in terminal would be very nice though. Kitty, for example, implements its own thing (icat), and integrates well with ranger. Would be lovely to have that in Terminal.

Sixel or whatever iTerm2 does are also nice, I think Sixel support is in the pipeline? Not supported by ranger yet, though.

@DHowett-MSFT commented on GitHub (May 11, 2020): Comments from #4544. from @zyy1998 > # Display images in terminal > I'm trying to use **_WSL_** to substitute some functions on windows, it performed well in some text-only functions. But I'm also want to use **_ranger_** ( a linux terminal file explorer ) to replace **_totalcommander_** which I often used or even **_windows file explorer_**, **_ranger_** satisfies my content in many occasions but for image preview. > > **_w3m_** is a terminal web browser that could be used to display images in terminal, and it can also be used by **_ranger_**. However, **_w3m_** didn't work on this terminal. > > There are many other terminals like **_iTerm2_**、**_urxvt_** and **_alacritty_** could display images. As a terminal under windows, I think it's more necessary to support this feature. > > # Proposed technical implementation details > I don't know how does w3m works, but I have noticed that the terminal could be changed the background pictures, so if you want to render some images, you can just change the specific area of the background of the terminal. Actually it's how **_urxvt_** handled it. > > Of course, you don't have to support w3m, just do something that could display images correctly and the method could be called by other apps like **_ranger_**, that's all what I need. > > Thanks! ( And pardon for my poor English😁 ) > > You can find more information here: https://github.com/ranger/ranger/wiki/Image-Previews from @akho > w3m and überzug both rely on x11 to draw an image in a subwindow. It is highly unlikely that either of the two can be made to work in Terminal without also modifying the tools themselves. > > Having some way to draw images in terminal would be very nice though. Kitty, for example, implements its own thing (icat), and integrates well with ranger. Would be lovely to have that in Terminal. > > Sixel or whatever iTerm2 does are also nice, I think Sixel support is in the pipeline? Not supported by ranger yet, though.
Author
Owner

@remkop commented on GitHub (May 19, 2020):

This discussion between the authors of various terminal emulators may be relevant: https://gitlab.freedesktop.org/terminal-wg/specifications/issues/12

It looks like MinTTY went ahead and implemented iTerm2 escape sequences so perhaps this is worth considering as a de facto standard.

@remkop commented on GitHub (May 19, 2020): This discussion between the authors of various terminal emulators may be relevant: https://gitlab.freedesktop.org/terminal-wg/specifications/issues/12 It looks like [MinTTY went ahead](https://github.com/mintty/mintty/wiki/Tips#image-support) and implemented [iTerm2 escape sequences](https://www.iterm2.com/documentation-images.html) so perhaps this is worth considering as a de facto standard.
Author
Owner

@egmontkob commented on GitHub (May 31, 2020):

See also https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/26.

@egmontkob commented on GitHub (May 31, 2020): See also https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/26.
Author
Owner
@j4james commented on GitHub (May 31, 2020): > See also https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/26. https://xkcd.com/927/
Author
Owner

@dotnetCarpenter commented on GitHub (Jul 24, 2020):

I tried to use feh in terminal but I needed X11 running. So I tried both VcXsrv Windows X Server and MobaXterm Home Edition. In both cases, I need to forward to X11 and open Windows firewall TCP port 6000 as described on StackOverflow.

But both also had a lot more than I need or want. And both will only display images in their own terminal. I want to use Microsoft terminal and I want images to look like the mockup at wslutiliti.es (using feh).

I googled how to run X11 server in MS terminal and found this issue... I hope it's feasible. 🤷

@dotnetCarpenter commented on GitHub (Jul 24, 2020): I tried to use [`feh`](https://feh.finalrewind.org) in terminal but I needed X11 running. So I tried both [VcXsrv Windows X Server](https://sourceforge.net/projects/vcxsrv/) and [MobaXterm Home Edition](https://mobaxterm.mobatek.net). In both cases, I need to forward to X11 and open Windows firewall TCP port 6000 as described on [StackOverflow](https://stackoverflow.com/questions/61110603/how-to-set-up-working-x11-forwarding-on-wsl2). But both also had a lot more than I need or want. And both will only display images in their own terminal. I want to use Microsoft terminal and I want images to look like [the mockup at wslutiliti.es (using `feh`)](https://wslutiliti.es). I googled how to run X11 server in MS terminal and found this issue... I hope it's feasible. 🤷
Author
Owner

@metawrap-dev commented on GitHub (Aug 10, 2020):

It would be fantastic if I could just pipe out HTML5 from my console app and have it display on the terminal.

How about that?

@metawrap-dev commented on GitHub (Aug 10, 2020): It would be fantastic if I could just pipe out HTML5 from my console app and have it display on the terminal. How about that?
Author
Owner

@zadjii-msft commented on GitHub (Aug 10, 2020):

@metawrap-dev How would you propose that would actually work? How would you specify a size for the HTML content to take up within the terminal buffer? How would you deal with scenarios like ssh, where the end terminal might be on another machine entirely, or something like tmux where the end terminal isn't actually a terminal with a physical size in pixels, only in characters?

How would you suppose the terminal actually parse and render the HTML content? A WebView? Embed en entire electron instance? Is JS supported as well, or just HTML?

There's a lot more questions in that suggestion than there are for just "display images", so maybe that discussion warrants its own thread.

@zadjii-msft commented on GitHub (Aug 10, 2020): @metawrap-dev How would you propose that would actually work? How would you specify a size for the HTML content to take up within the terminal buffer? How would you deal with scenarios like ssh, where the end terminal might be on another machine entirely, or something like tmux where the end terminal isn't actually a terminal with a physical size in pixels, only in characters? How would you suppose the terminal actually parse and render the HTML content? A WebView? Embed en entire electron instance? Is JS supported as well, or just HTML? There's a _lot_ more questions in that suggestion than there are for just "display images", so maybe that discussion warrants its own thread.
Author
Owner

@sintaxx commented on GitHub (Aug 26, 2020):

has there been any progress on displaying images in WSL2's terminal ?

@sintaxx commented on GitHub (Aug 26, 2020): has there been any progress on displaying images in WSL2's terminal ?
Author
Owner

@DHowett commented on GitHub (Aug 26, 2020):

no. If you'd like updates, click on the subscribe button to the right.
As long as this issue is open and there have been no comments indicating progress, you can reasonably expect that there hasn't been any progress.

@DHowett commented on GitHub (Aug 26, 2020): no. If you'd like updates, click on the subscribe button to the right. As long as this issue is open and there have been no comments indicating progress, you can reasonably expect that there hasn't been any progress.
Author
Owner

@JekRock commented on GitHub (Aug 29, 2020):

Here is an interesting project about rendering videos in a terminal https://github.com/ghaiklor/terminal-canvas

@JekRock commented on GitHub (Aug 29, 2020): Here is an interesting project about rendering videos in a terminal https://github.com/ghaiklor/terminal-canvas
Author
Owner

@dinhanhx commented on GitHub (Oct 24, 2020):

Here is the closest thing I found https://github.com/nabijaczleweli/termimage

@dinhanhx commented on GitHub (Oct 24, 2020): Here is the closest thing I found https://github.com/nabijaczleweli/termimage
Author
Owner

@MuizU commented on GitHub (Feb 12, 2021):

Has anyone had any success using ueberzug?

@MuizU commented on GitHub (Feb 12, 2021): Has anyone had any success using ueberzug?
Author
Owner

@dinhanhx commented on GitHub (Feb 13, 2021):

Has anyone had any success using ueberzug?

https://github.com/microsoft/terminal/issues/4544#issuecomment-626187986

@dinhanhx commented on GitHub (Feb 13, 2021): > Has anyone had any success using ueberzug? https://github.com/microsoft/terminal/issues/4544#issuecomment-626187986
Author
Owner

@bushnerd commented on GitHub (Feb 23, 2021):

Has anyone had any success using ueberzug?

I test it, it did not work.

@bushnerd commented on GitHub (Feb 23, 2021): > Has anyone had any success using ueberzug? I test it, it did not work.
Author
Owner

@zacknorman commented on GitHub (Mar 11, 2021):

Just wanted to chime in as I'm excited for this... specifically being able to properly run neofetch with w3m wallpaper support...

If it's any help, I think the escape sequence in iTerm2 would be the best case. I've always used that on MacOS and it's exceptional. Another one worth looking into might be tycat from the terminology terminal in enlightenment.

Looking forward to seeing this happen - and honestly - I'd love to help out with it.

@zacknorman commented on GitHub (Mar 11, 2021): Just wanted to chime in as I'm excited for this... specifically being able to properly run [neofetch](https://github.com/dylanaraps/neofetch) with w3m wallpaper support... If it's any help, I think the escape sequence in iTerm2 would be the best case. I've always used that on MacOS and it's exceptional. [Another one worth looking into might be tycat from the terminology terminal in enlightenment](https://manpages.debian.org/unstable/terminology-data/tycat.1.en.html). Looking forward to seeing this happen - and honestly - I'd love to help out with it.
Author
Owner

@hhoeflin commented on GitHub (Jun 18, 2021):

Here another very good program for converting images to something that can be displayed in terminal with a lot of different options.

https://github.com/hpjansson/chafa

@hhoeflin commented on GitHub (Jun 18, 2021): Here another very good program for converting images to something that can be displayed in terminal with a lot of different options. https://github.com/hpjansson/chafa
Author
Owner

@bragmore commented on GitHub (Sep 19, 2021):

why is there no support for this yet?

@bragmore commented on GitHub (Sep 19, 2021): why is there no support for this yet?
Author
Owner

@christianparpart commented on GitHub (Sep 19, 2021):

why is there no support for this yet?

Because it's complicated.

Because ConPTY needs to support that (e.g. via VT passthrough) first before any other terminal on windows can display images generically.

Best chances are to get it via #1173 .

@christianparpart commented on GitHub (Sep 19, 2021): > why is there no support for this yet? Because it's complicated. Because ConPTY needs to support that (e.g. via VT passthrough) **first** before any other terminal on windows can display images generically. Best chances are to get it via #1173 .
Author
Owner

@danielbisar commented on GitHub (Jan 22, 2022):

A workaround is using kitty terminal on Windows 11 without running vcxsrv. Performance of the terminal is a bit slower than Windows Terminal on my machine but kittys icat is works

https://github.com/danielbisar/settings/blob/main/guides/kitty-on-windows-with-wsl2.md

@danielbisar commented on GitHub (Jan 22, 2022): A workaround is using kitty terminal on Windows 11 without running vcxsrv. Performance of the terminal is a bit slower than Windows Terminal on my machine but kittys icat is works https://github.com/danielbisar/settings/blob/main/guides/kitty-on-windows-with-wsl2.md
Author
Owner

@koszeggy commented on GitHub (Dec 17, 2022):

Apart from some well-supported future API for this, it would be nice if at least the legacy solutions were not broken. It has been working since Windows XP until Windows 10 and even ConEmu emulates this behavior. And a sort of popular console apps such as Far Manager could utilize it in some clever ways:
Image in pre-Windows 11 console window

Unfortunately this no longer works with Windows 11 Terminal. I don't know what's missing to make it work again because GetConsoleWindow still returns the console handle as a Win32 HWND and even the Graphics::FromHWND method returns a seemingly valid instance, it's just its VisibleClipBounds is always an empty rectangle.

@koszeggy commented on GitHub (Dec 17, 2022): Apart from some well-supported future API for this, it would be nice if at least the [legacy solutions](https://stackoverflow.com/a/33652557/5114784) were not broken. It has been working since Windows XP until Windows 10 and even [ConEmu](https://conemu.github.io/en/Screenshots.html) emulates this behavior. And a sort of popular console apps such as [Far Manager](https://www.farmanager.com/download.php?l=en) could utilize it in some clever ways: ![Image in pre-Windows 11 console window](https://farplugs.sourceforge.io/img/imageview.png) Unfortunately this no longer works with Windows 11 Terminal. I don't know what's missing to make it work again because [`GetConsoleWindow`](https://learn.microsoft.com/en-us/windows/console/getconsolewindow) still returns the console handle as a Win32 HWND and even the [Graphics::FromHWND](https://learn.microsoft.com/en-us/windows/win32/api/gdiplusgraphics/nf-gdiplusgraphics-graphics-fromhwnd) method returns a seemingly valid instance, it's just its [VisibleClipBounds](https://learn.microsoft.com/en-us/windows/win32/api/gdiplusgraphics/nf-gdiplusgraphics-graphics-getvisibleclipbounds(rect)) is always an empty rectangle.
Author
Owner

@odell0111 commented on GitHub (Oct 13, 2023):

The Python package, image-in-terminal, performs well by replacing every two pixels of an image with the character ▀ (Upper Half Block). This makes it most suitable for displaying low-resolution images. While images with higher resolutions can also be displayed in the terminal, performance may decrease and the terminal’s contents will need to be zoomed out to view the images. This package served my small project well, and it might also be useful for others until the Windows Terminal implements support for displaying images

@odell0111 commented on GitHub (Oct 13, 2023): The Python package, [image-in-terminal](https://pypi.org/project/image-in-terminal), performs well by replacing every two pixels of an image with the character ▀ (Upper Half Block). This makes it most suitable for displaying low-resolution images. While images with higher resolutions can also be displayed in the terminal, performance may decrease and the terminal’s contents will need to be zoomed out to view the images. This package served my small project well, and it might also be useful for others until the Windows Terminal implements support for displaying images
Author
Owner

@Shailosingh commented on GitHub (Nov 2, 2023):

Hey! I recently have been using Windows Terminal to SSH into a Linux VM and found out that there is functionality within neofetch to change the ASCII image to a real image (I know I'm late). However, it wasn't working on my Windows Terminal so I googled and found this issue page.

I notice that it is very old so I have some questions:

  1. Is this still a feature being considered? Does the team consider rendering images within the Terminal a priority?
  2. I am pretty sure most people would want this for WSL but, if this feature got finished, is there a chance it would work when Linux is open via SSH (like in my case)?
@Shailosingh commented on GitHub (Nov 2, 2023): Hey! I recently have been using Windows Terminal to SSH into a Linux VM and found out that there is functionality within neofetch to change the ASCII image to a real image (I know I'm late). However, it wasn't working on my Windows Terminal so I googled and found this issue page. I notice that it is very old so I have some questions: 1. Is this still a feature being considered? Does the team consider rendering images within the Terminal a priority? 2. I am pretty sure most people would want this for WSL but, if this feature got finished, is there a chance it would work when Linux is open via SSH (like in my case)?
Author
Owner

@lhecker commented on GitHub (Nov 3, 2023):

Yes, to both questions. An initial implementation would almost certainly implement sixels first, since we already have a basic sixel parser (and related code) and it's the most basic of format. And sixels work over SSH. (Edit: And the linked formats both support SSH as well.)

@lhecker commented on GitHub (Nov 3, 2023): Yes, to both questions. An initial implementation would almost certainly implement sixels first, since we already have a basic sixel parser (and related code) and it's the most basic of format. And sixels work over SSH. (Edit: And the linked formats both support SSH as well.)
Author
Owner

@Shailosingh commented on GitHub (Nov 3, 2023):

Yes, to both questions. An initial implementation would almost certainly implement sixels first, since we already have a basic sixel parser (and related code) and it's the most basic of format. And sixels work over SSH. (Edit: And the linked formats both support SSH as well.)

Oh wow, that's great! Thanks for the update!

@Shailosingh commented on GitHub (Nov 3, 2023): > Yes, to both questions. An initial implementation would almost certainly implement sixels first, since we already have a basic sixel parser (and related code) and it's the most basic of format. And sixels work over SSH. (Edit: And the linked formats both support SSH as well.) Oh wow, that's great! Thanks for the update!
Author
Owner

@iSeiryu commented on GitHub (Feb 13, 2024):

why is there no support for this yet?

Because it's complicated.

Because ConPTY needs to support that (e.g. via VT passthrough) first before any other terminal on windows can display images generically.

Best chances are to get it via #1173 .

https://github.com/microsoft/terminal/issues/1173#issuecomment-1600968653
Windows Terminal Preview has a hidden setting for this now:

"experimental.connection.passthroughMode": true,
@iSeiryu commented on GitHub (Feb 13, 2024): > > why is there no support for this yet? > > Because it's complicated. > > Because ConPTY needs to support that (e.g. via VT passthrough) **first** before any other terminal on windows can display images generically. > > Best chances are to get it via #1173 . https://github.com/microsoft/terminal/issues/1173#issuecomment-1600968653 Windows Terminal Preview has a hidden setting for this now: ```json "experimental.connection.passthroughMode": true, ```
Author
Owner

@trackd commented on GitHub (Nov 22, 2024):

having spent a fair amount of time playing around with the different Image protocols in Sixel Module

which supports Sixel and experimental support for IIP and Kitty Graphics.

I really wish WT implemented Kitty Graphics Protocol

Using the image binary data like InlineImageProtocol and Kitty does is just way easier and faster.

And kitty gives you alot of control on how to render, position, animation and supports compression etc.

Sixel is really cool but feels kinda inefficient in comparison.

@trackd commented on GitHub (Nov 22, 2024): having spent a fair amount of time playing around with the different Image protocols in [Sixel Module](https://github.com/trackd/Sixel) which supports Sixel and experimental support for IIP and Kitty Graphics. I really wish WT implemented [Kitty Graphics Protocol](https://sw.kovidgoyal.net/kitty/graphics-protocol/) Using the image binary data like InlineImageProtocol and Kitty does is just way easier and faster. And kitty gives you alot of control on how to render, position, animation and supports compression etc. Sixel is really cool but feels kinda inefficient in comparison.
Author
Owner

@ldemailly commented on GitHub (May 14, 2025):

Having just added kitty support to my TUIs - it's really easy when you already generate PNG, basically chunk and base64 (and you don't actually need to chunk) - I would love that basic support (no need to do the shm or file based/local, just the inline transmission) in Windows Terminal as well.

edit: link to code https://github.com/grol-io/grol/blob/v0.89.0/examples/cards.gr#L438-L451

func kitty(img) {
    data := image.png(img)
    chunkSize := 4096 // Spec says 4k but... anything seems to work.
    for len(data) > chunkSize {
        chunk := data[0:chunkSize]
        data = data[chunkSize:]
        // q=1 no ok ack but keep errors in case there are.
        // technically we don't need it seems to repeat the f=100, only a=T/m=1 after the first chunk
        // but it's only a few bytes and cleaner like this.
        print("\x1b_Ga=T,f=100,q=1,m=1;")
        print(base64(chunk))
        print("\x1b\\")
    }
    print("\x1b_Ga=T,f=100,q=1;" + base64(data) + "\x1b\\\n") // m=0 is default for last chunk.
}
@ldemailly commented on GitHub (May 14, 2025): Having just added kitty support to my TUIs - it's really easy when you already generate PNG, basically chunk and base64 (and you don't _actually_ need to chunk) - I would love that basic support (no need to do the shm or file based/local, just the inline transmission) in Windows Terminal as well. edit: link to code https://github.com/grol-io/grol/blob/v0.89.0/examples/cards.gr#L438-L451 ```go func kitty(img) { data := image.png(img) chunkSize := 4096 // Spec says 4k but... anything seems to work. for len(data) > chunkSize { chunk := data[0:chunkSize] data = data[chunkSize:] // q=1 no ok ack but keep errors in case there are. // technically we don't need it seems to repeat the f=100, only a=T/m=1 after the first chunk // but it's only a few bytes and cleaner like this. print("\x1b_Ga=T,f=100,q=1,m=1;") print(base64(chunk)) print("\x1b\\") } print("\x1b_Ga=T,f=100,q=1;" + base64(data) + "\x1b\\\n") // m=0 is default for last chunk. } ```
Author
Owner

@j4james commented on GitHub (May 24, 2025):

you don't actually need to chunk

Just a word of warning to anyone reading this, you definitely do need to chunk. The reason chunking is mandated in the protocol is to work around an issue an issue in kitty where the screen gets flooded with garbage if you use a string sequence over a certain size. The threshold for triggering that feature was raised some time ago, so it's less likely to be a problem now, but if you create an image that's large enough, and you aren't using chunks, kitty users can still be impacted by this.

@j4james commented on GitHub (May 24, 2025): > you don't _actually_ need to chunk Just a word of warning to anyone reading this, you definitely _do_ need to chunk. The reason chunking is mandated in the protocol is to work around an issue an issue in kitty where the screen gets flooded with garbage if you use a string sequence over a certain size. The threshold for triggering that feature was raised some time ago, so it's less likely to be a problem now, but if you create an image that's large enough, and you aren't using chunks, kitty users can still be impacted by this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7944