Skip to content

return Err when image but no image backend #289

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

Merged
merged 6 commits into from
Oct 25, 2020
Merged

Conversation

o2sh
Copy link
Owner

@o2sh o2sh commented Oct 22, 2020

I removed the panic!("No image backend found") from Info.fmt() and I added a check in case the user chose an image-backend not supported by his terminal.


By the way, I noticed that kitty::KittyBackend::supported() and sixel::SixelBackend::supported() need to println!() a sequence of characters in order to check if the corresponding backend is supported, resulting in two empty lines if both check fail:

out

I tried wrapping both methods into smth like (+ replace println! by print!):

    pub fn supported() -> bool {
        let is_supported = KittyBackend::is_supported();
        print!("\r");
        is_supported
    }

but it broke everything 😭

@o2sh o2sh requested a review from shuni64 October 22, 2020 18:02
@o2sh o2sh mentioned this pull request Oct 23, 2020
@o2sh o2sh merged commit ab2e9f3 into master Oct 25, 2020
@o2sh o2sh deleted the remove-panic-from-info-fmt branch November 4, 2020 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants