sindresorhus/term-img

Support tmux

Offen

#1 geöffnet am 20.03.2016

 (4 Kommentare) (8 Reaktionen) (0 zugewiesene Personen)JavaScript (12 Forks)user submission
enhancementhelp wanted

Repository-Metriken

Stars
 (318 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

It requires some wrapper escape codes to please it.

https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat

Specifically:

# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
# only accepts ESC backslash for ST.
function print_osc() {
    if [[ $TERM == screen* ]] ; then
        printf "\033Ptmux;\033\033]"
    else
        printf "\033]"
    fi
}

# More of the tmux workaround described above.
function print_st() {
    if [[ $TERM == screen* ]] ; then
        printf "\a\033\\"
    else
        printf "\a"
    fi
}

I will get to this eventually, but I don't use tmux, so not a priority. A pull request would be welcomed :)

Contributor Guide