gpt4 book ai didi

Tmux命令不起作用

转载 作者:行者123 更新时间:2023-12-04 07:35:36 25 4
gpt4 key购买 nike

当我按ctrl + b(按住它们的同时)按钮,然后按c按钮时,没有任何 react 。 ctrl + b命令组合无效。仅以下两个命令有效:

tmux new-session -s {session-name}
tmux kill-session -t {session-name}

另外,我无法创建新的嵌套 session 。如何创建新 session 。是否有使用tmux的模式,如vim。例如。在正常/命令模式下,按 esc;在插入模式下,按 i;在可视模式下,按 v。我问这个问题是因为我怀疑在发出ctrl + b + n之类的键命令之前是否需要按一些键。它们只是在终端中以普通文本的形式写入。

字符输入到终端中。请参见下面的屏幕截图。我正在使用 here的所有tmux,zsh,vim配置

enter image description here

请检查我的tmux.config文件
set -g default-command "reattach-to-user-namespace -l zsh"
# tmux display things in 256 colors
set -g default-terminal "screen-256color"
set -g status-utf8 on

# automatically renumber tmux windows
set -g renumber-windows on

# unbind default prefix and set it to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# for nested tmux sessions
bind-key a send-prefix

# Activity Monitoring
setw -g monitor-activity off
set -g visual-activity off

# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on

# make delay shorter
set -sg escape-time 0

# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1

######################
#### Key Bindings ####
######################

# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"

# split window and fix path for tmux 1.9
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

# synchronize all panes in a window
bind y setw synchronize-panes

# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

bind -r C-h select-window -t :-
bind -r C-l select-window -t :+

# Resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10

# enable mouse support for switching panes/windows
# NOTE: This breaks selecting/copying text on OSX
# To select text as expected, hold Option to disable it (iTerm2)
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on

# set vi mode for copy mode
setw -g mode-keys vi

# more settings to make copy-mode more vim-like
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection

# Buffers to/from Mac clipboard, yay tmux book from pragprog
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"

最佳答案

您已将配置中的默认转义序列更改为:从Ctrl-B(默认为tmux)更改为Ctrl-A(就像类似的终端多路复用器screen一样)。

相关的配置行在第三段中:

# unbind default prefix and set it to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix

如果您想使用默认的tmux,只需注释掉(使用领先的 #)或删除 tmux.conf中的以上几行即可。

关于Tmux命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33855209/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com