1
0
mirror of https://github.com/samoshkin/tmux-config.git synced 2026-01-07 02:08:01 +00:00

Add option to control usage of sharing copy buffer using OSC 52 method

This commit is contained in:
Alexey Samoshkin
2017-11-24 23:57:34 +02:00
parent 86d1c9d3b0
commit 6377634a56
3 changed files with 15 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ is_app_installed() {
buf=$(cat "$@")
copy_backend_remote_tunnel_port=$(tmux show-option -gvq "@copy_backend_remote_tunnel_port")
copy_use_osc52_fallback=$(tmux show-option -gvq "@copy_use_osc52_fallback")
# Resolve copy backend: pbcopy (OSX), reattach-to-user-namespace (OSX), xclip/xsel (Linux)
copy_backend=""
@@ -31,7 +32,13 @@ if [ -n "$copy_backend" ]; then
exit;
fi
# If no copy backends were eligible, fallback to OSC 52 escape sequences
# If no copy backends were eligible, decide to fallback to OSC 52 escape sequences
# Note, most terminals do not handle OSC
if [ "$copy_use_osc52_fallback" == "off" ]; then
exit;
fi
# Copy via OSC 52 ANSI escape sequence to controlling terminal
buflen=$( printf %s "$buf" | wc -c )