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

Support tmux passing escapes through tmux #2

Open
dsanson opened this issue Apr 21, 2016 · 2 comments
Open

Support tmux passing escapes through tmux #2

dsanson opened this issue Apr 21, 2016 · 2 comments

Comments

@dsanson
Copy link

dsanson commented Apr 21, 2016

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!

@sindresorhus
Copy link
Owner

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

@dsanson
Copy link
Author

dsanson commented Apr 22, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants