Fixed tmux to work with OSC 52

This commit is contained in:
Eric Renfro 2023-10-28 12:49:25 -04:00
parent b2869ececd
commit 84528f514c
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF

View file

@ -2,9 +2,10 @@
# === General Settings ===
# ==========================
set-option -sa terminal-overrides ",$TERM:RGB"
set-option -ga terminal-overrides ",$TERM:Tc"
set -g default-terminal "screen-256color"
#set-option -sa terminal-overrides ",$TERM:RGB"
#set-option -ga terminal-overrides ",$TERM:Tc"
#set -g default-terminal "screen-256color"
#set -g default-terminal "tmux-256color"
set -g history-limit 5000
set -g buffer-limit 20
set -sg escape-time 10
@ -72,7 +73,10 @@ bind X confirm-before -p "kill-window #W? (y/n)" kill-window
# ================================================
# === Copy mode, scroll and clipboard ===
# ================================================
set -g @copy_use_osc52_fallback off
#set -g @copy_use_osc52_fallback off
set -s set-clipboard on
#set -as terminal-features ',screen-256color:clipboard'
set -sa terminal-features ",alacritty*:256:RGB:bpaste:clipboard:mouse:strikethrough:title:ccolour:cstyle:focus:overline:usstyle:hyperlinks:sync"
# Prefer vi style key table
setw -g mode-keys vi
@ -85,26 +89,27 @@ bind C-p choose-buffer
yank="~/.tmux/yank.sh"
# Copy selected text
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "$yank"
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$yank"
#bind -T copy-mode-vi Y send-keys -X copy-line \;\
# Copy selected text (removed for testing)
#bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "$yank"
#bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$yank"
##bind -T copy-mode-vi Y send-keys -X copy-line \;\
## run "tmux save-buffer - | $yank"
#bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "$yank; tmux paste-buffer"
#bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "$yank"
#bind-key -T copy-mode-vi D send-keys -X copy-end-of-line \;\
# run "tmux save-buffer - | $yank"
#bind-key -T copy-mode-vi A send-keys -X append-selection-and-cancel \;\
# run "tmux save-buffer - | $yank"
bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "$yank; tmux paste-buffer"
bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "$yank"
bind-key -T copy-mode-vi D send-keys -X copy-end-of-line \;\
run "tmux save-buffer - | $yank"
bind-key -T copy-mode-vi A send-keys -X append-selection-and-cancel \;\
run "tmux save-buffer - | $yank"
# Copy selection on drag end event, but do not cancel copy mode and do not clear selection
# clear select on subsequence mouse click
#bind -T copy-mode-vi MouseDragEnd1Pane \
# send-keys -X copy-pipe "$yank"
unbind -T copy-mode-vi MouseDragEnd1Pane
bind -T copy-mode-vi MouseDown1Pane select-pane \;\
send-keys -X copy-pipe "$yank" \;\
send-keys -X clear-selection
## Copy selection on drag end event, but do not cancel copy mode and do not clear selection
## clear select on subsequence mouse click
##bind -T copy-mode-vi MouseDragEnd1Pane \
## send-keys -X copy-pipe "$yank"
#unbind -T copy-mode-vi MouseDragEnd1Pane
#bind -T copy-mode-vi MouseDown1Pane select-pane \;\
# send-keys -X copy-pipe "$yank" \;\
# send-keys -X clear-selection
# End (removed for testing) Section
set -g bell-action any