Alacritty + tmux는 복사 모드에서 텍스트의 큰 부분을 복사할 수 없습니다

Alacritty + tmux는 복사 모드에서 텍스트의 큰 부분을 복사할 수 없습니다

MacOS에서는 tmux + zsh를 민첩하게 사용합니다. tmux를 복사 모드로 전환하고 텍스트의 큰 부분을 선택하고 키를 누르면 y이 텍스트가 내 버퍼에 없어 붙여넣을 수 없습니다. 그러나 iTerm에서는 작동합니다. 여기 나의 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'

답변1

나는 alacritty가 OSC 52를 사용하여 클립보드를 설정하는 데 길이 제한이 있다고 생각하지만 tmux-yank를 사용하고 있으므로 tmux에게 set -g set-clipboard off와 함께 사용하지 말라고 지시할 수 있습니다. 둘 다 경쟁하고 문제를 일으킬 수 있으므로 둘 다 사용해서는 안됩니다.

답변2

2022년 Mac/Alacritty/Tmux에서 저에게 도움이 된 내용은 다음과 같습니다.

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"

즉, reattach-to-user-namespace나 때문에 문제가 발생했습니다.

관련 정보