charmbracelet / vhs

Your CLI home video recorder 📼
MIT License
14.97k stars 248 forks source link

Terminal graphics support #43

Open joouha opened 1 year ago

joouha commented 1 year ago

It would be nice if vhs supported terminal graphics (i.e. sixel / kitty / iterm2 graphics protocols).

tsl0922 commented 1 year ago

It's already supported with ttyd 1.7.2

NOTE: for the main branch, it's not enabled by default now, you will need to run ttyd with -t enableSixel=true to enable it (see Client Options).

maaslalani commented 1 year ago

Neat, I'm making a PR to enable that option right now! Thanks @tsl0922 (and also thank you for all the help on ttyd side for this project ❤️)

maaslalani commented 1 year ago

I've enabled the option but there's still some work in order to be done to support the images in VHS that I can handle a bit later. Mainly, it involves capturing the xterm-image-layer (like we do with text / cursor layers).

I want to make this opt-in since capturing the image layers will result in slightly less frame rates, so it's important to have something like:

Set Sixel Enabled

so that we don't capture the image layer if it is not necessary.

blacktop commented 4 weeks ago

ping 🔔 this would be great to have! 🙏 (kitty support is prob the most popular right now)

blacktop commented 4 weeks ago

@maaslalani wait is kitty support already added? I see you mentioned a PR, but don't see it ref'd in this issue anywhere?

blacktop commented 4 weeks ago

I made this dumb repo, but maybe we could build off of it, or move it somewhere in charm etc

https://github.com/blacktop/go-termimg

lusingander commented 3 weeks ago

I created a fork that addresses this issue and confirmed that it works. https://github.com/lusingander/vhs

Unfortunately, it seems that we can't simply load xterm-image-layer (because the xterm image addon was fixed after this issue was created). I thought it would be nice to push the fix to this repository as well, but at least the way I envision it would require fixes to xterm.js and ttyd as well (details can be found in the README of the fork repository.)

Is there a big demand for this fix? Or does anyone have any other good approaches in mind?