ansi-escapes icon indicating copy to clipboard operation
ansi-escapes copied to clipboard

Support tmux passing escapes through tmux

Open dsanson opened this issue 9 years ago • 2 comments

Any chance of supporting this? You can see the basic trick at the top of the original imgcat bash script:

# 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
}

This would make it possible to use termimg from within tmux, which would be cool!

dsanson avatar Apr 21 '16 23:04 dsanson

Yes, I need it for https://github.com/sindresorhus/term-img/issues/1. Haven't had the chance yet though, so PR welcome :)

sindresorhus avatar Apr 22 '16 01:04 sindresorhus

Ah! Didn't see that issue at term-img.

dsanson avatar Apr 22 '16 14:04 dsanson