如何从系统剪贴板粘贴到 tmux

cur*_*rge 6 vim tmux windows-subsystem-for-linux

我正在将 tmux 与 WSL(Ubuntu 18.04)一起使用,但我不知道如何粘贴到 tmux 中。只需右键单击即可在普通终端上进行粘贴,但这在 tmux 中不起作用。

所有在线教程似乎都解释了如何将文本从 tmux 复制到我通过 tmux-yank 工作的系统剪贴板,但系统剪贴板到 tmux 没有运气。

编辑:默认情况下,这似乎适用于大多数人。我可以提供哪些对调试最有帮助的信息?

更新:我意识到右键单击当前可以让我移动分隔两个垂直选项卡的栏。我没有在任何地方设置这种行为,这可能来自哪里?这是我上网的 tmux conf:

# Set a new prefix / leader key.
set -g prefix M-j
bind M-j send-prefix

# Allow opening multiple terminals to view the same session at different sizes.
setw -g aggressive-resize on

# Remove delay when switching between Vim modes.
set -sg escape-time 10

# Allow Vim's FocusGained to work when your terminal gains focus.
#   Requires Vim plugin: https://github.com/tmux-plugins/vim-tmux-focus-events
set -g focus-events on

# Add a bit more scroll history in the buffer.
set -g history-limit 50000

# Enable color support inside of tmux.
set -g default-terminal "screen-256color"

# Ensure window titles get renamed automatically.
setw -g automatic-rename

# Ensure window index numbers get reordered on delete.
set-option -g renumber-windows on

# Start windows and panes index at 1, not 0.
set -g base-index 1
setw -g pane-base-index 1

# Enable full mouse support.
set -g mouse on

# Status bar optimized for Gruvbox.
set -g status-fg colour244
set -g status-bg default
set -g status-left ''
set -g status-right-length 0
#set -g status-right-length 20
#set -g status-right '%a %Y-%m-%d %H:%M'

set -g pane-border-fg default
set -g pane-border-bg default
set -g pane-active-border-fg colour250
set -g pane-active-border-bg default

set-window-option -g window-status-current-attr bold
set-window-option -g window-status-current-fg colour223

# -----------------------------------------------------------------------------
# Key bindings
# -----------------------------------------------------------------------------

# Unbind default keys
unbind C-b
unbind '"'
unbind %

# Reload the tmux config.
bind-key r source-file ~/.tmux.conf

# Split panes.
bind-key h split-window -v
bind-key v split-window -h

# Move around panes with ALT + arrow keys.
bind-key -n M-Up select-pane -U
bind-key -n M-Left select-pane -L
bind-key -n M-Down select-pane -D
bind-key -n M-Right select-pane -R

# -----------------------------------------------------------------------------
# Plugin Manager - https://github.com/tmux-plugins/tpm
# In order to use the plugins below you need to install TPM and the plugins.
#   Step 1) git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
#   Step 2) Reload tmux if it's already started with `r
#   Step 3) Launch tmux and hit `I (capital i) to fetch any plugins
# -----------------------------------------------------------------------------

#bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
#`bind -t vi-copy y copy-pipe "xclip -sel clip -i"

# List of plugins.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'

# Initialize TPM (keep this line at the very bottom of your tmux.conf).
run -b '~/.tmux/plugins/tpm/tpm'
Run Code Online (Sandbox Code Playgroud)

cur*_*rge 9

这个帖子解决了。

按住“Shift”将恢复操作系统默认行为,然后让我通过选择 + 右键单击​​进行复制并通过右键单击进行粘贴。