Alacritty + tmux não pode copiar grande parte do texto no modo de cópia

Alacritty + tmux não pode copiar grande parte do texto no modo de cópia

Eu uso tmux + zsh em alacritty no MacOS. Quando mudo o tmux para o modo de cópia, selecionando uma grande parte do texto e pressionando y, esse texto não está no meu buffer e não consigo colá-lo. Mas no iTerm funciona. Aqui está o meu tmux.conf:

setw -g mode-keys vi
set -g default-terminal screen-256color

# bind y key in copy mode to select and copy to system clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and- 
cancel "reattach-to-user-namespace pbcopy"

# bind ctrl+v to paste in tmux
bind-key -n C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; 
tmux paste-buffer"

# smart pane switching with awareness of vim splits
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

# reload config file (change file location to your the tmux.conf you 
want to use)
bind r source-file ~/.tmux.conf

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-yank'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'

Responder1

Acho que o alacritty tem um limite de comprimento para usar o OSC 52 para definir a área de transferência, mas como você está usando o tmux-yank, você pode simplesmente dizer ao tmux para não usá-lo com set -g set-clipboard desativado. Você não deve usar os dois de qualquer maneira, porque eles irão correr e causar problemas.

Responder2

Aqui está o que funcionou para mim no Mac/Alacritty/Tmux em 2022:

setw -g mode-keys vi
set -g set-clipboard off
bind-key -T copy-mode-vi v send-keys -X begin-selection
# bind y key in copy mode to select and copy to system clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"

Ou seja, o reattach-to-user-namespaceestava quebrando tudo para mim

informação relacionada