Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]Add the ability to remove individual images. #219

Open
Sem1Rose opened this issue Sep 30, 2024 · 5 comments
Open

[Feature request]Add the ability to remove individual images. #219

Sem1Rose opened this issue Sep 30, 2024 · 5 comments
Labels
feature New feature or request

Comments

@Sem1Rose
Copy link

The --clear option clears the entire terminal window, but i want to keep the terminal contents and only remove a specific image, similar to Ueberzugpp's identifier option.
OS: Arch linux
Terminal: kitty

@Sem1Rose Sem1Rose changed the title Add the ability to remove individual images. [Feature request]Add the ability to remove individual images. Sep 30, 2024
@hpjansson
Copy link
Owner

Thanks for filing the issue. This wouldn't be too hard to do, since we already support identifiers at the API level. However, it would only work with the Kitty protocol. The command line could look something like this:

Show image(s): chafa -f kitty --image-id 5 (shown images would be assigned IDs in ascending order starting at 5).
Remove image: chafa -f kitty --image-id 5 --remove-image

Would this do what you want, or are you using --clear with multiple images (e.g. a slideshow) and need it to remove the image before showing the next, instead of clearing everything?

@Sem1Rose
Copy link
Author

Sem1Rose commented Oct 2, 2024

Thanks for the reply,
I think what I'm trying to achieve isn't about clearing the images, it's more about "don't display that specific image anymore." So for example, i have a bunch of images, each with its own description. Now, what i want to achieve is that for one of these images to just "cease to exist" without affecting the other images or their descriptions.
I'm not really home atm to test these commands, but as soon as im back I'll give them a go, hopefully this'll be exactly what I'm trying to achieve.

@hpjansson
Copy link
Owner

Ah, the options don't exist yet, it's just my suggestion for how we could implement this. Based on your description of the issue, it sounds like what you need.

Are you calling chafa from another program?

@Sem1Rose
Copy link
Author

Sem1Rose commented Oct 2, 2024

the options don't exist yet

Bummer, i hope you have time to implement it soon, fingers crossed it doesn't take too much time.

Are you calling chafa from another program?

yeah, i am, it's a rust program i've been working on for a while now. In a nutshell, i'm not directly using chafa to display images in the terminal, since this would take too much time. Instead, i'm caching the output of chafa for each image, and then to display the image i just print the cached output to the terminal, which takes significantly less time than just directly using chafa.

Edit: Actually, now that i think about it, will this method work with the --remove-image option? i'm not really sure, i think it depends on the implementation.

@hpjansson
Copy link
Owner

I think it could work, but only with the Kitty protocol. Chafa also supports symbol mosaics, sixels and iTerm, and it wouldn't work with those.

@hpjansson hpjansson added the feature New feature or request label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants