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

Image rendering #633

Open
adriangalilea opened this issue Jul 27, 2024 · 2 comments
Open

Image rendering #633

adriangalilea opened this issue Jul 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@adriangalilea
Copy link

Are there any plans to render images?

@adriangalilea adriangalilea added the enhancement New feature or request label Jul 27, 2024
@pmarreck
Copy link

Would like this too, perhaps via magick convert to sixel.

The problem is, detecting sixel support in terminals seems to be completely all over the place. For example, here is my (very custom) sixel detection bash function:

check_sixel_support() {
    if infocmp -1 | grep -q "sixel"; then
        # Sixel support detected directly via terminfo
        return 0
    fi
    if [[ "$TERM_PROGRAM" == "WezTerm" ]]; then
        return 0
    fi
    if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
        return 1
    fi
    if [[ -n "$WSLENV" ]]; then
        # WSL as of 2024 does not support sixel
        return 1
    fi
    if [[ -n "$ALACRITTY_LOG" || -n "$ALACRITTY_WINDOW_ID" ]]; then
        # Note that Alacritty may be close to releasing sixel support (?)
        # https://github.com/alacritty/alacritty/pull/4763
        return 1
    fi
    if [[ "$TERM" == "xterm-256color" ]]; then
        # sometimes i like cool-retro-term, but alas, no sixels, which...
        # ...it's a retro terminal emulator, so duh
        parent_process=$(ps -p $PPID -o comm=)
        if [[ "$parent_process" == *"cool-retro-term"* ]]; then
            return 1
        fi
    fi
    if [[ "$TERM_PROGRAM" == "WarpTerminal" ]]; then
        return 1
    fi
    if [[ "$TERM_PROGRAM" == "Hyper" ]]; then
        return 1
    fi
    # for anything else, optimistically assume xterm-256color supports sixel
    case "$TERM" in
        xterm-256color | xterm-kitty | mlterm | yaft | wezterm)
            return 0
            ;;
    esac
    # if all else fails, fail
    return 1
}

@vitaly-zdanevich
Copy link

Kitty can show images https://sw.kovidgoyal.net/kitty/kittens/icat/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants