Created
October 14, 2018 20:08
-
-
Save wookayin/6e09c6af8612864484f791ee9297d6f7 to your computer and use it in GitHub Desktop.
Test script for reproducing a tmux passthrough bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function print_osc() { | |
if [[ -n $TMUX ]] ; then | |
printf "\033Ptmux;\033\033]"; | |
else printf "\033]"; fi | |
} | |
function print_st() { | |
if [[ -n $TMUX ]] ; then | |
printf "\a\033\\" | |
else printf "\a"; fi | |
} | |
function send_file() { | |
# sends a dummy file containing $REPEAT '.' characters | |
REPEAT=${1:-1024} | |
filename=$(echo -ne "test-$REPEAT.txt" | base64) | |
echo "Sending a text data of $REPEAT bytes ..." | |
print_osc | |
printf "1337;File=name=$filename;size=$REPEAT;inline=0:" | |
head -c $REPEAT < /dev/zero | tr '\0' '.' | base64 | |
print_st | |
} | |
send_file $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment