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
1 changed files with 27 additions and 22 deletions

View File

@ -2,9 +2,10 @@
# === General Settings === # === General Settings ===
# ========================== # ==========================
set-option -sa terminal-overrides ",$TERM:RGB" #set-option -sa terminal-overrides ",$TERM:RGB"
set-option -ga terminal-overrides ",$TERM:Tc" #set-option -ga terminal-overrides ",$TERM:Tc"
set -g default-terminal "screen-256color" #set -g default-terminal "screen-256color"
#set -g default-terminal "tmux-256color"
set -g history-limit 5000 set -g history-limit 5000
set -g buffer-limit 20 set -g buffer-limit 20
set -sg escape-time 10 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 === # === 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 # Prefer vi style key table
setw -g mode-keys vi setw -g mode-keys vi
@ -85,26 +89,27 @@ bind C-p choose-buffer
yank="~/.tmux/yank.sh" yank="~/.tmux/yank.sh"
# Copy selected text # 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 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-pipe-and-cancel "$yank"
#bind -T copy-mode-vi Y send-keys -X copy-line \;\ ##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" # 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 ## Copy selection on drag end event, but do not cancel copy mode and do not clear selection
# clear select on subsequence mouse click ## clear select on subsequence mouse click
#bind -T copy-mode-vi MouseDragEnd1Pane \ ##bind -T copy-mode-vi MouseDragEnd1Pane \
# send-keys -X copy-pipe "$yank" ## send-keys -X copy-pipe "$yank"
unbind -T copy-mode-vi MouseDragEnd1Pane #unbind -T copy-mode-vi MouseDragEnd1Pane
bind -T copy-mode-vi MouseDown1Pane select-pane \;\ #bind -T copy-mode-vi MouseDown1Pane select-pane \;\
send-keys -X copy-pipe "$yank" \;\ # send-keys -X copy-pipe "$yank" \;\
send-keys -X clear-selection # send-keys -X clear-selection
# End (removed for testing) Section
set -g bell-action any set -g bell-action any