mirror of
https://github.com/kvcache-ai/sglang.git
synced 2026-07-02 21:37:11 +00:00
13 lines
409 B
Bash
Executable File
13 lines
409 B
Bash
Executable File
#!/bin/bash
|
|
put() {
|
|
esc=$1
|
|
test -n "$TMUX" -o -z "${TERM##screen*}" && esc="\033Ptmux;\033$esc\033\\"
|
|
printf "$esc"
|
|
}
|
|
put "\033]52;c;!\a"
|
|
buf=$( cat "$@" )
|
|
len=$( printf %s "$buf" | wc -c ) max=74994
|
|
test $len -gt $max && echo "$0: input is $(( len - max )) bytes too long" >&2
|
|
put "\033]52;c;$( printf %s "$buf" | head -c $max | base64 | tr -d '\r\n' )\a"
|
|
test -n "$TMUX" && tmux set-buffer "$buf" ||:
|