Ctrl+up来调整会话的大小。这在tmux-action-组合体+ Alt+up中不会发生,它将按预期调整屏幕的大小。注意:所有其他箭头键和tmux组合键工作良好,没有任何问题.
我有种感觉,这需要处理从旧版本的tmux导入的键绑定。
配置:这是我为.tmux.conf使用的配置
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins/'
# This session is allow Mobaxterm sessions to scroll without having to hold SHIFT after reattaching
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Set default TERM type
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",*256col*:Tc"
# Enable mouse control
set -g mouse on
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
#set -g status off
set-option -g status-position top
set -sg escape-time 0
set -g focus-events on
# enable vim bindings for copy mode
set-window-option -g mode-keys vi
# copy to system clipboard
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind-key -n C-h select-pane -L
bind-key -n C-j select-pane -D
bind-key -n C-k select-pane -U
bind-key -n C-l select-pane -R
#Copy and paste from terminal (non-vim)
bind-key -T copy-mode C-w send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind p paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
unbind '"'
unbind %
bind n split-window -v -c '#{pane_current_path}'
bind m split-window -h -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
bind r command-prompt "respawn-pane -k" \
#tmux sync all screens in windows
bind -n C-y setw synchronize-panes
###########
# Plugins #
###########
#Install Plugins
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
#Plugin: tmux-resurrect
set -g @resurrect-processes ':all:'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-capture-pane-contents 'on'
#Plugin: tmux-continuum
set -g @continuum-save-interval '15'
set -g @continuum-restore 'on'
set -g status-right 'Continuum status: #{continuum_status}'
#Initalize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'下面是tmux-action-组合体+ ?中出现的内容:
bind-key -T copy-mode Up send-keys -X cursor-up
bind-key -T copy-mode M-Up send-keys -X halfpage-up
bind-key -T copy-mode C-Up send-keys -X scroll-up我在这里错过了什么?为什么tmux不允许我在ssh会话中使用Up,或者使用tmux-action-组合体+ Up来调整窗格的大小?
发布于 2022-04-23 17:33:15
弄明白了。
我上面定义的两个问题需要重新定义。实际问题如下:
问题1的
原因: Juniper主机没有识别tmux窗格正确使用的$TERM值,也没有遵守向上或向下的箭头键。
解决方案:我删除了已有的两个术语设置,并将该术语设置为xterm-256color (Ubuntu实例的默认设置)。这就解决了问题:
# Set default TERM type
set -g default-terminal "xterm-256color"
# set -g default-terminal "screen-256color"
# set-option -ga terminal-overrides ",*256col*:Tc"问题2的
原因:当我直接从Ubuntu框中使用tmux时,没有发生这个问题。这个问题确实发生在我从我的电脑上进行VNC时。经过更多的故障排除后,我发现这个问题是由我的主机上的另一个应用程序引起的,我使用我的VNC客户端是因为干扰了"Ctrl+Up“密钥组合,这意味着密钥组合体从未通过VNC会话发送。
解决方案:删除干扰应用程序上的组合键后,通过VNC客户端正确发送组合键"Ctrl+Up“,并再次使用tmux。
https://unix.stackexchange.com/questions/699479
复制相似问题